Re: Open by inode? (was Re: knfsd)

Andi Kleen (ak@muc.de)
03 Jan 1999 14:13:17 +0100


In article <19990102122948.E238@perlsupport.com>,
chip@perlsupport.com (Chip Salzenberg) writes:
> According to Alan Cox:
>> NFS likes to work at the inode level and its awkward to get at that
>> [from user space]. If you could open by inode with some other stuff
>> from the kernel hooked and write a clone based UNFSD then probably
>> [knfsd would be unnecessary].

> Is there any reason why the superuser shouldn't be able to open by
> inode? This seems an obvious idea; perhaps there's also an obvious
> argument against it that I'm not seeing...

It is an layering violation.

In 2.2 all VFS functions work on a dcache entry which refers to a filename,
not an inode. To open by inode you have to play very dirty tricks: you would
have to generate a dummy name and insert it into the dcache, but not write
it to the physical filesystem[1]. The current knfsd avoids the problem
completely by handing out (inode, parentdir) tokens, based on that information
it can regenerate the complete path and use the dentry directly.

Also some filesystems don't have fixed inodes.

-Andi

[1] I have some very hackish code that does that and implements an open by
inode ioctl, but I wouldn't want to see it in a released kernel.

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