Date: Thu, 27 May 2010 18:07:20 +0000 (UTC) From: John Baldwin <jhb@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/nfsclient nfs_vnops.c Message-ID: <201005271807.o4RI7hEw088506@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
jhb 2010-05-27 18:07:20 UTC FreeBSD src repository Modified files: sys/nfsclient nfs_vnops.c Log: SVN rev 208603 on 2010-05-27 18:07:20Z by jhb More gracefully handle stale file handles and attributes when opening a file via NFS. Specifically, to satisfy close-to-open-consistency, the NFS client always performs at least one RPC on a file during an open(2) to see if the file has changed. Normally this RPC is an ACCESS or GETATTR RPC that is forced by flushing a file's attribute cache during nfs_open() and then requesting new attributes. However, if the file is noticed to be stale during nfs_open(), the only recourse is to fail the open(2) call with ESTALE. On the other hand, if the ACCESS or GETATTR RPC is sent during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to obtain the new file handle in the case that a file has been replaced. This change causes the NFS client to flush the attribute cache during nfs_lookup() when validating a name cache hit if the attributes fetched during nfs_lookup() can be reused in nfs_open(). This allows the client to open a replaced file via the new file handle the first time that it notices a replaced file rather than failing with ESTALE in some cases. Reviewed by: rmacklem, bde Reviewed by: mohans (older version) MFC after: 1 week Revision Changes Path 1.326 +20 -3 src/sys/nfsclient/nfs_vnops.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005271807.o4RI7hEw088506>