Date: Sun, 13 Apr 2008 13:18:04 -0700 From: Kirk McKusick <mckusick@mckusick.com> To: Jeff Roberson <jroberson@jroberson.net> Cc: arch@freebsd.org Subject: Re: VOP_LEASE Message-ID: <200804132018.m3DKI4MG007310@chez.mckusick.com>
next in thread | raw e-mail | index | archive | help
The explanation is correct that VOP_LEASE is present so that an NFS server is made aware when a file is used locally so that the server can take appropriate action on the leases that it has extended to its clients. Because VOP_LEASE is not under a lock, the race that Jeff points out is also valid. To be race-free, they would need to be protected by the vnode lock. Most instances of them are still protected by the vnode lock, though some key ones (like READ and WRITE) fell out of being protected when the vnode lock was pushed down so that it no longer protected f_offset updates. Using the pre- and post- hooks in the vnode operations would be an equally valid place to do the leasing call-back to the NFS (or other remote filesystem) server. As the VOP_LEASE calls were, at least at the time they were in use, correctly placed and indentified read or write access, it might be useful to figure out the appropriate set of pre- and post- hooks as part of their removal. Kirk McKusick
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200804132018.m3DKI4MG007310>