diff options
| author | Kinglong Mee <kinglongmee@gmail.com> | 2014-08-04 16:18:16 +0800 | 
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-08-04 16:51:38 -0400 | 
| commit | 5b53dc88b064cb93274e7fb81f8df477287c80df (patch) | |
| tree | 94b3eff48b9e917ec2ce9f7ffa3b2a93b3293372 | |
| parent | 122a8cda6a9a3594c4737570f5cd81636bcd20cf (diff) | |
NFS: Avoid infinite loop when RELEASE_LOCKOWNER getting expired error
Fix Commit 60ea681299 (NFS: Migration support for RELEASE_LOCKOWNER)
If getting expired error, client will enter a infinite loop as,
client                            server
   RELEASE_LOCKOWNER(old clid) ----->
                <--- expired error
   RENEW(old clid)             ----->
                <--- expired error
   SETCLIENTID                 ----->
                <--- a new clid
   SETCLIENTID_CONFIRM (new clid) -->
                <--- ok
   RELEASE_LOCKOWNER(old clid) ----->
                <--- expired error
   RENEW(new clid)             ----->
                <-- ok
   RELEASE_LOCKOWNER(old clid) ----->
                <--- expired error
   RENEW(new clid)             ----->
                <-- ok
                ... ...
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
[Trond: replace call to nfs4_async_handle_error() with
 nfs4_schedule_lease_recovery()]
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
| -rw-r--r-- | fs/nfs/nfs4proc.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 66fd901d5fae..75ae8d22f067 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -5942,8 +5942,10 @@ struct nfs_release_lockowner_data {  static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata)  {  	struct nfs_release_lockowner_data *data = calldata; -	nfs40_setup_sequence(data->server, -				&data->args.seq_args, &data->res.seq_res, task); +	struct nfs_server *server = data->server; +	nfs40_setup_sequence(server, &data->args.seq_args, +				&data->res.seq_res, task); +	data->args.lock_owner.clientid = server->nfs_client->cl_clientid;  	data->timestamp = jiffies;  } @@ -5960,6 +5962,8 @@ static void nfs4_release_lockowner_done(struct rpc_task *task, void *calldata)  		break;  	case -NFS4ERR_STALE_CLIENTID:  	case -NFS4ERR_EXPIRED: +		nfs4_schedule_lease_recovery(server->nfs_client); +		break;  	case -NFS4ERR_LEASE_MOVED:  	case -NFS4ERR_DELAY:  		if (nfs4_async_handle_error(task, server, NULL) == -EAGAIN)  | 
