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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions daemon/mgr/container_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ func (mgr *ContainerManager) generateMountPoints(ctx context.Context, c *Contain
return errors.Wrap(err, "failed to populate volumes")
}

// set volumes into /etc/mtab in container
err = mgr.setMountTab(ctx, c)
if err != nil {
return errors.Wrap(err, "failed to set mount tab")
}

return nil
}

Expand Down Expand Up @@ -703,6 +697,11 @@ func (mgr *ContainerManager) initContainerStorage(ctx context.Context, c *Contai
logrus.Warnf("failed to set rootfs disk quota, err(%v)", err)
}

// set volumes into /etc/mtab in container
if err = mgr.setMountTab(ctx, c); err != nil {
return errors.Wrap(err, "failed to set mount tab")
}

return nil
}

Expand Down
4 changes: 4 additions & 0 deletions storage/quota/quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

return 0, errors.Wrapf(err, "failed to set dir(%s) quota recursively", dir)
}
}

return quotaID, nil
Expand Down