[OpenAFS] MailDir & Coda/AFS was: Practical no. of files per dir was: [OpenAFS] Max number of files in volume?

Jeffrey Hutzelman jhutz@cmu.edu
Mon, 17 May 2004 15:26:32 -0400


On Monday, May 17, 2004 14:59:02 -0400 Derek Atkins <warlord@MIT.EDU> wrote:

> Mike Fedyk <mfedyk@matchmail.com> writes:
>
>> BTW, why can't AFS allow hard links within a single volume?  Doesn't
>> the client know where separate volumes are mounted in the /afs tree?
>
> It would violate acl semantics.  I could link a file from a directory
> where I only have 'l' access into a directory where I have 'rl' access
> and then be able to read the file.  Or I could link it into a
> directory where I have 'write' access and change the file.  Which
> directory ACL is to be believed if you allow cross-directory links?

It's actually even a little more complex than Derek makes it out to be. 
The protocol between the fileserver and cache manager identifies files by 
FID, not pathname (this is actually important, because it means that if I 
open a file and then you rename it, the wrong thing doesn't happen). 
Because of this, and because access control is per-directory, the 
fileserver needs to be able to determine the parent directory of any file 
given only its FID (volume ID, vnode number, and uniqifier), without any 
further help from the client.  The way it does this is to store in each 
file's vnode index entry the vnode number of its parent.  There is room for 
only one parent (and as Derek points out, if there were more than one, how 
would you know which one to use?), and so each file can be in only one 
directory.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA