Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: /etc/mtab will miss quota id #2675

Merged
merged 1 commit into from
Jan 21, 2019

Conversation

rudyfly
Copy link
Collaborator

@rudyfly rudyfly commented Jan 17, 2019

Ⅰ. Describe what this PR did

if set /etc/mtab before set rootfs quota, it will make /etc/mtab miss
quota id of rootfs quota, so it need be moved after set rootfs quota.

with overlay work dir, it disappear work/work, when only set the dir
work's quota id, if we remove set dir quota id by recursively, the
quota id for overlay is invalid.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

I have no good idea

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: Rudy Zhang rudyflyzhang@gmail.com

if set `/etc/mtab` before set rootfs quota, it will make /etc/mtab miss
quota id of rootfs quota, so it need be moved after set rootfs quota.

with overlay work dir, it disappear `work/work`, when only set the dir
`work`'s quota id, if we remove set dir quota id by recursively, the
quota id for overlay is invalid.

Signed-off-by: Rudy Zhang <rudyflyzhang@gmail.com>
@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

Merging #2675 into master will increase coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2675      +/-   ##
=========================================
+ Coverage   69.18%   69.2%   +0.01%     
=========================================
  Files         285     285              
  Lines       18958   18959       +1     
=========================================
+ Hits        13117   13120       +3     
  Misses       4371    4371              
+ Partials     1470    1468       -2
Flag Coverage Δ
#criv1alpha1test 31.3% <0%> (-0.02%) ⬇️
#criv1alpha2test 35.39% <0%> (-0.08%) ⬇️
#integrationtest 42.01% <0%> (+0.05%) ⬆️
#nodee2etest 32.17% <0%> (ø) ⬆️
#unittest 26.96% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
storage/quota/quota.go 44.64% <0%> (-0.41%) ⬇️
daemon/mgr/container_storage.go 61.03% <0%> (-0.09%) ⬇️
apis/server/utils.go 71.15% <0%> (-3.85%) ⬇️
ctrd/container.go 56.81% <0%> (-0.39%) ⬇️
cri/v1alpha2/cri.go 69.77% <0%> (+0.49%) ⬆️
daemon/mgr/container_utils.go 83.92% <0%> (+0.59%) ⬆️
daemon/mgr/spec_linux.go 79.73% <0%> (+0.99%) ⬆️

@pouchrobot pouchrobot added kind/bug This is bug report for project size/S labels Jan 17, 2019
@@ -231,6 +231,10 @@ func SetRootfsDiskQuota(basefs, size string, quotaID uint32) (uint32, error) {
if err := SetDiskQuota(dir, size, quotaID); err != nil {
return 0, errors.Wrapf(err, "failed to set dir(%s) disk quota", dir)
}

if err := SetQuotaForDir(dir, quotaID); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this operate slow start time when lot of files locates

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because of overlay Upper and Work have no files.

Copy link
Contributor

@Ace-Tang Ace-Tang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HusterWan
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jan 21, 2019
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants