Re: RFC - tree quotas for Linux (2.4.12, ext2)

Jan Kara (jack@suse.cz)
Wed, 24 Oct 2001 17:16:58 +0200


Hello,

> In my ongoing effort to provide centralised file storage that I can
> be proud of, I have put together some code to implement tree quotas.
>
> The idea of a tree quota is that the block and inode usage of a file
> is charged to the (owner of the root of the) tree rather than the
> owner (or group owner) of the file.
> This will (I hope) make life easier for me. There are several
> reasons that I have documented (see URL below) but a good one is that
> they are transparent and predictable. du -s $HOME should *always*
> match your usage according to "quota".
>
> I have written a patch which is included below, but also is at
> htttp://www.cse.unsw.edu.au/~neilb/patches/linux/
>
> which defines a third type of quotas for Linux, named "treequotas".
> The patch supports these quotas for ext2 by borrowing (or is that
> stealing) i_reserved2 from the on-disc inode to store the "tid",
> which is the uid of the ultimate non-root parent of the file.
>
> There are obvious issues with hardlinks between trees with different
> tree-ids, but they can be easily restricted to root who should know
> better.
>
> The patch introduces the concept of a "Treeid" or "tid" which is
> inherited from the parent, if not zero, or set from the uid
> otherwise.
> Thus if root creates a directory near the top of a filesystem and
> chowns it to someone, all files created beneath that directory,
> independant of ownership, get charged to the someone (for the purpose
> of treequotaing).
But how do you solve the following: mv <dir> <some_other_dir>
The parent changes. You need to go through all the subdirs of <dir> and change
the TID. This is really hard to get right and to avoid deadlocks
and races... At least it seems to me so.

Honza
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/