2010-03-12 10:15:59

by Mi Jinlong

[permalink] [raw]
Subject: [PATCH] Fix bug nfslock request sending fail will be process as blocked


If local reason cause nfslock request send fail(means status < 0,
resp->status not be reset), the request will be process as blocked
at first now.

This patch initialize resp->status to nlm_lck_denied_nolocks, it
can make the following process correctly.

Signed-off-by: Mi Jinlong <[email protected]>
---
fs/lockd/clntproc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
index c81249f..a631582 100644
--- a/fs/lockd/clntproc.c
+++ b/fs/lockd/clntproc.c
@@ -535,7 +535,7 @@ again:
* Initialise resp->status to a valid non-zero value,
* since 0 == nlm_lck_granted
*/
- resp->status = nlm_lck_blocked;
+ resp->status = nlm_lck_denied_nolocks;
for(;;) {
/* Reboot protection */
fl->fl_u.nfs_fl.state = host->h_state;
--
1.6.5.2




2010-03-12 13:42:18

by Trond Myklebust

[permalink] [raw]
Subject: Re: [PATCH] Fix bug nfslock request sending fail will be process as blocked

On Fri, 2010-03-12 at 18:17 +0800, Mi Jinlong wrote:
> If local reason cause nfslock request send fail(means status < 0,
> resp->status not be reset), the request will be process as blocked
> at first now.
>
> This patch initialize resp->status to nlm_lck_denied_nolocks, it
> can make the following process correctly.
>
> Signed-off-by: Mi Jinlong <[email protected]>
> ---
> fs/lockd/clntproc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c
> index c81249f..a631582 100644
> --- a/fs/lockd/clntproc.c
> +++ b/fs/lockd/clntproc.c
> @@ -535,7 +535,7 @@ again:
> * Initialise resp->status to a valid non-zero value,
> * since 0 == nlm_lck_granted
> */
> - resp->status = nlm_lck_blocked;
> + resp->status = nlm_lck_denied_nolocks;
> for(;;) {
> /* Reboot protection */
> fl->fl_u.nfs_fl.state = host->h_state;

We _want_ to process it as being blocked if the RPC call was
interrupted. The above patch will cause the client to just abandon the
interrupted lock request without sending the CANCEL request...

Trond