Skip to content

Commit

Permalink
nfs4: renewd renew operations should take/put a client reference
Browse files Browse the repository at this point in the history
renewd sends RENEW requests to the NFS server in order to renew state.
As the request is asynchronous, renewd should take a reference to the
nfs_client to prevent concurrent umounts from freeing the client

Signed-off-by: Alexandros Batsakis <batsakis@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Alexandros Batsakis authored and Trond Myklebust committed Mar 2, 2010
1 parent 7135840 commit 0851de0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3152,7 +3152,9 @@ static void nfs4_renew_release(void *data)
{
struct nfs_client *clp = data;

nfs4_schedule_state_renewal(clp);
if (atomic_read(&clp->cl_count) > 1)
nfs4_schedule_state_renewal(clp);
nfs_put_client(clp);
}

static void nfs4_renew_done(struct rpc_task *task, void *data)
Expand Down Expand Up @@ -3185,6 +3187,8 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred)
.rpc_cred = cred,
};

if (!atomic_inc_not_zero(&clp->cl_count))
return -EIO;
return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT,
&nfs4_renew_ops, clp);
}
Expand Down

0 comments on commit 0851de0

Please sign in to comment.