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
Add overlay2.inode storage opt (xfs) #34694
Comments
What would be usecases? |
Hey @AkihiroSuda , my use case is placing a hard limit on the number of inodes that a user can create in its container such that it can't affect too much the underlying fs (as that counter is shared with all containers as I see - let me know if I got this wrong). When a user creates a container with a huge amount of files (even though they're not open) it takes a lot of time to It's already possible to limit the number of open file descriptors via ulimits ( |
hey @cirocosta , I followed your instructions to place a hard limit on the number of inodes for each container which backingfs is xfs. And I can see the limit of Inodes had already been set. BUT I found that the sum of free inodes is wrong when i use the command
some research updated. https://my.oschina.net/markz0928/blog/3045719 |
Nowadays it's possible to set project quotas if the underlying filesystem is XFS and uses
overlay2
as the graph driver (see https://github.com/moby/moby/blob/master/daemon/graphdriver/overlay2/overlay.go) but it only allows setting a limit on disk blocks.That's very good but we could extend the functionality to also support
inodes
as it's just an extra field defined infs_disk_quota
:(from https://github.com/torvalds/linux/blob/42ff72cf27027fa28dd79acabe01d9196f1480a7/include/uapi/linux/dqblk_xfs.h#L57-L60)
My proposal is to update
Quota
to includeinodes
:moby/daemon/graphdriver/quota/projectquota.go
Lines 64 to 66 in 184cea5
In
overlay.go
we could check for the optionoverlay2.inodes
moby/daemon/graphdriver/overlay2/overlay.go
Lines 233 to 240 in 184cea5
and then set
Quota.Inodes
properly.With that it's a matter of setting the values in the struct:
moby/daemon/graphdriver/quota/projectquota.go
Lines 180 to 181 in 184cea5
(naturally that should come with some bound checking, etc).
I'd be willing to implement the feature if desired.
Wdyt?
Thx!
Update: we also need to update the bitmask:
moby/daemon/graphdriver/quota/projectquota.go
Line 179 in 184cea5
so that it includes
The text was updated successfully, but these errors were encountered: