]> err.no Git - linux-2.6/commit
NLM: don't unlock on cancel requests
authorJ. Bruce Fields <bfields@fieldses.org>
Tue, 3 Jan 2006 08:55:44 +0000 (09:55 +0100)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 6 Jan 2006 19:58:53 +0000 (14:58 -0500)
commit5996a298da43a03081e9ba2116983d173001c862
tree533a3289102051cc3e033eff5730301776e64d31
parentf232142cc21127c829559923eb405d1bcb2e2278
NLM: don't unlock on cancel requests

 Currently when lockd gets an NLM_CANCEL request, it also does an unlock for
 the same range.  This is incorrect.

 The Open Group documentation says that "This procedure cancels an
 *outstanding* blocked lock request."  (Emphasis mine.)

 Also, consider a client that holds a lock on the first byte of a file, and
 requests a lock on the entire file.  If the client cancels that request
 (perhaps because the requesting process is signalled), the server shouldn't
 apply perform an unlock on the entire file, since that will also remove the
 previous lock that the client was already granted.

 Or consider a lock request that actually *downgraded* an exclusive lock to
 a shared lock.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/lockd/svclock.c
fs/locks.c