diff --git a/daemon/mgr/container_storage.go b/daemon/mgr/container_storage.go index 4f034698b..9c90d0470 100644 --- a/daemon/mgr/container_storage.go +++ b/daemon/mgr/container_storage.go @@ -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 } @@ -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 } diff --git a/storage/quota/quota.go b/storage/quota/quota.go index 25b100e7c..436ddcac3 100644 --- a/storage/quota/quota.go +++ b/storage/quota/quota.go @@ -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 { + return 0, errors.Wrapf(err, "failed to set dir(%s) quota recursively", dir) + } } return quotaID, nil