NLM/lockd: convert __nlm_async_call to use rpc_run_task()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 28 Mar 2008 20:04:36 +0000 (16:04 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 19 Apr 2008 20:53:39 +0000 (16:53 -0400)
commitdc9d8d048168ff61c458bec06b28996cb90b182a
treef8160237a79f96837696bc7dfa91efc96e9b84ed
parent5e7f37a76fa5b604949020b7317962262812b2dd
NLM/lockd: convert __nlm_async_call to use rpc_run_task()

Peter Staubach comments:

> In the course of investigating testing failures in the locking phase of
> the Connectathon testsuite, I discovered a couple of things.  One was
> that one of the tests in the locking tests was racy when it didn't seem
> to need to be and two, that the NFS client asynchronously releases locks
> when a process is exiting.
...
> The Single UNIX Specification Version 3 specifies that:  "All locks
> associated with a file for a given process shall be removed when a file
> descriptor for that file is closed by that process or the process holding
> that file descriptor terminates.".
>
> This does not specify whether those locks must be released prior to the
> completion of the exit processing for the process or not.  However,
> general assumptions seem to be that those locks will be released.  This
> leads to more deterministic behavior under normal circumstances.

The following patch converts the NFSv2/v3 locking code to use the same
mechanism as NFSv4 for sending asynchronous RPC calls and then waiting for
them to complete. This ensures that the UNLOCK and CANCEL RPC calls will
complete even if the user interrupts the call, yet satisfies the
above request for synchronous behaviour on process exit.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/lockd/clntproc.c