On Mon, Jan 10, 2022 at 08:58:55AM +1100, NeilBrown wrote: > On Thu, 06 Jan 2022, 'bfields@xxxxxxxxxxxx' wrote: > > > +Locking can also provide cache consistency: > > .P > > -NLM supports advisory file locks only. > > -To lock NFS files, use > > -.BR fcntl (2) > > -with the F_GETLK and F_SETLK commands. > > -The NFS client converts file locks obtained via > > -.BR flock (2) > > -to advisory locks. > > +Before acquiring a file lock, the client revalidates its cached data for > > +the file. Before releasing a write lock, the client flushes to the > > +server's stable storage any data in the locked range. > > Surely the client revalidates *after* acquiring the lock on the server. > Otherwise the revalidation has now value. Gah. @@ -1489,9 +1493,9 @@ locks. .P Locking can also provide cache consistency: .P -Before acquiring a file lock, the client revalidates its cached data for -the file. Before releasing a write lock, the client flushes to the -server's stable storage any data in the locked range. +After acquiring a file lock and before using any cached data, the client +revalidates its cache. Before releasing a write lock, the client flushes to +the server's stable storage any data in the locked range. .P A distributed application running on multiple NFS clients can take a read lock for each range that it reads and a write lock for each range that --b.