Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2009 09:48:48 -0400
From:      Linda Messerschmidt <linda.messerschmidt@gmail.com>
To:        Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: FreeBSD 7.2 + NFS + nullfs + unlink + fstat = Stale NFS File  Handle
Message-ID:  <237c27100910280648k597e2159sf4fd663fe7b77b3b@mail.gmail.com>
In-Reply-To: <20091028124832.GA7852@pm513-1.comsys.ntu-kpi.kiev.ua>
References:  <237c27100910271013s1d8602d0l74d7d9d2c137adee@mail.gmail.com> <20091028124832.GA7852@pm513-1.comsys.ntu-kpi.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 28, 2009 at 8:48 AM, Andrey Simonenko
<simon@comsys.ntu-kpi.kiev.ua> wrote:
> As I understand when a file is opened in NULLFS its vnode gets new
> reference on 'count of users', but this new reference is not propagated
> to the lower vnode (vnode that is under NULLFS). =A0When a file is remove=
d
> NULLFS passes this op to the lower FS (NFS in this example) and that
> FS sees that its vnode has only a single reference on 'count of users'.
>
> In case of NFS when there is a request to remove a vnode it checks that
> value of 'count of users' for this vnode. =A0If this count is equal to 1,
> then NFS client code does 'RPC remove'. =A0If this count is greater than =
1
> (for example when a file is opened), then NFS client code renames pathnam=
e
> to .nfs-file, but does not send 'RPC remove' to the NFS server.

That sounds like a pretty reasonable explanation of what's going on.

Unfortunately it does sound like this would be tough to fix.  Since
NFS deletes are a special case, short of making an NFS-aware nullfs,
which seems silly, it sounds like the "solution" would be rewriting
nullfs to propagate the reference count.  I don't know enough about
nullfs to know exactly how hard that would be, but I'm guessing it's
not the work of a lazy afternoon. :-)

>> =A0 =A0 =A0 if (!fd) {
> =A0 =A0 =A0 =A0 =A0 ^^^^^ should be (fd < 0)

Oops, you are right!

Thanks very much!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?237c27100910280648k597e2159sf4fd663fe7b77b3b>