Re: Proposal: restrict link(2)

Craig Milo Rogers (
Fri, 13 Dec 96 13:51:54 PST

>Since this is a quota issue, let's just focus on that: If QUOTA's are
>enabled, we restrict hard link to the owner. Otherwise quota is non-viable.

Well, there are other possible solutions, but they'd require
a lot more work. COnsider extending ext2fs to include, in each file's
metadata, a list (possibly long!) of the inodes of all the directories
containing hard links to the file. There would be excruciating race
conditions, of course, but with such a scheme you might:

1) Automatically unlink a file from all other directories when
the file's owner unlinks it from the last directory owned
by that owner (not a very good idea, of course, if you
like to use shared directories for multiperson projects).

2) Split the charges for the file's space against the quotas
of the owner(s) of the directories in which the file is
hard linked.

3) (2) only when the file doesn't appear in any directories
owned by the files's own owner.

Craig Milo Rogers