Subject: Re: Addition to force open to open only regular files
To: None <email@example.com, firstname.lastname@example.org>
From: Wolfgang Solfrank <email@example.com>
Date: 11/29/2000 14:48:55
> # The race saved by getfh() I think causes kernel resources to be
> # consumed. The getfh call locks the leaf and leaving it locked on
> # return to userland seems to be dangerous to me.
> ...it locks the leaf? Really?
getfh() certainly doesn't lock the leaf. After all, what should unlock it?
Remember that the initial use of getfh() was for the NFS server. To be
precise, since the NFS server is in the kernel, it doesn't need any
syscall to get to a file handle. It's for the NFS mount daemon, which
gets requests from some NFS client to return a filehandle for a given
path (after checking permissions, of course) and therefore needs a way
to translate a pathname to a filehandle.
And at that time, getfh() was the only syscall that had anything to do
with filehandles (well, technically, the nfssvc syscall had to do with
filehandles, too, but there the handles were only communicated via
the network, not via the system call).
So there didn't exist any possibility to unlock the leaf after the call
to getfh(). And locking it wouldn't have made any sense in the first
place (NFS is stateless!).
ws@TooLs.DE Wolfgang Solfrank, TooLs GmbH +49-228-985800