RFC - tree quotas for Linux (2.4.12, ext2)
James Sutherland <[email protected]>:
Quoted 14 lines · Rik van Riel
Quoted 8 lines · James Sutherland
Quoted 6 lines
Yep, you're right: you'd need to ascend the target directory tree, increasing the cumulative size all the way up, then do the move and decrement the old location's totals in the same way. All wrapped up in a transaction (on journalled FSs) or have fsck rebuild the totals on a dirty mount. Fairly clean and painless on a JFS,
Quoted 4 lines
It's only clean and painless when you have infinite journal space. When your filesystem's journal isn't big enough to keep track of all the quota updates from an arbitrarily deep directory tree, you're in big trouble.
Quoted 4 lines
Good point. You should be able to do it in constant space, though:
identify the directory being modified, and the "height" to which you have ascended so far. That'll allow you to back out or redo the transaction later, which is enough I think?
There still remains the problem of hard links... They could be counted in two or more trees as long as two or more trees exist on one filesystem.
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]
Any opinions expressed are solely my own.
Quoted 2 lines · Jesse Pollard
There still remains the problem of hard links... They could be counted in two or more trees as long as two or more trees exist on one filesystem.
Obvious fix: prohibit hard links across tree quota boundries, including any that might be created by a rename.
It is an admin error to enable tree quotas on trees that have existing hard links.
While doing that, a sysctl or mount option to enable/disable hard linking to other people's files would be nice. Default to stopping the "feature" IMHO.