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

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 27, 2009 at 01:13:18PM -0400, Linda Messerschmidt wrote:
> 
> Does anyone know what the likely source of this different behavior is,
> and whether it is feasible to address?  Or is NFS+NULLFS just pushing
> the envelope a little too far?

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).  When a file is removed
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.  If this count is equal to 1,
then NFS client code does 'RPC remove'.  If this count is greater than 1
(for example when a file is opened), then NFS client code renames pathname
to .nfs-file, but does not send 'RPC remove' to the NFS server.

> 
> 	fd = open("testfile", O_RDWR | O_CREAT | O_TRUNC, 0666);
> 	if (!fd) {
           ^^^^^ should be (fd < 0)



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