Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 2003 01:07:00 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        uitm@blackflag.ru
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: open() and ESTALE error
Message-ID:  <200306200807.h5K870M7059110@gw.catspoiler.org>
In-Reply-To: <200306200718.LAA00471@slt.oz>

next in thread | previous in thread | raw e-mail | index | archive | help
On 20 Jun, Andrey Alekseyev wrote:

> In the normal situation, namecache entry+vnode+nfsnode+file handle may
> stay cached for a really long time (until re-used? deleted or renamed
> on the *client*). Expiring file handles (a new mechanism?) means much the
> same to me as simply obtaining a new name cache entry+other data
> on ESTALE :) I may be wrong, though.

One case where there is a difference between timing out old file handles
and just invalidating them on ESTALE:

client%	cmd1 > file1; cmd2 > file2
server% mv file1 tmpfile; mv file2 file1; mv tmpfile file1

wait an hour

client% cat /dev/null > file1

If file handles are cached indefinitely, and the client didn't recycle
the vnode for file1, which file on the server got truncated?  Since
neither file was deleted on the server, you can't rely on ESTALE to
detect this situation.

Question: does the timeout of the directory attributes cause open() do
do an NFS lookup on the file, or does open() just find the vnode in the
cache and use its cached handle?



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