Subject: Re: Addition to force open to open only regular files
To: None <email@example.com>
From: Warner Losh <firstname.lastname@example.org>
Date: 11/29/2000 00:04:47
In message <Pine.NEB.email@example.com> Greywolf writes:
: On Tue, 28 Nov 2000, Warner Losh wrote:
: # : Okay, is there a reason that getfh() shouldn't be mortal-enabled? It
: # : already does path checking for accessibility; and since a stat() on a
: # : non-readable file is ok, fhstat shouldn't be a problem, either.
: # stat on a non-readable file is a problem as it currently isn't
: # allowed.
: stat is most certainly allowed on a non-readable file! How else would
: ls(1) work? :-)
My mistake. I should have said that stat for non-readable files is
disallowed when components in the path are unreadable. My mistake for
: Damn. There's GOT to be a way to avoid the race condition; getfh() looked
: so ideal.
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.