diff options
author | Alexandros Batsakis <batsakis@netapp.com> | 2010-02-05 06:45:06 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-02 13:00:03 -0500 |
commit | 0851de06174e9800e76b26e4be0ca94294c09c8c (patch) | |
tree | 4049cd2aaa462eb0f4d206d3f8a07afa13f2c96d /fs/nfs/nfs4proc.c | |
parent | 7135840fc74699513d50e0c9c64922f2d38aa5e3 (diff) |
nfs4: renewd renew operations should take/put a client reference
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>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 663ae0c36834..68f1fe00c08c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3152,7 +3152,9 @@ static void nfs4_renew_release(void *data) | |||
3152 | { | 3152 | { |
3153 | struct nfs_client *clp = data; | 3153 | struct nfs_client *clp = data; |
3154 | 3154 | ||
3155 | nfs4_schedule_state_renewal(clp); | 3155 | if (atomic_read(&clp->cl_count) > 1) |
3156 | nfs4_schedule_state_renewal(clp); | ||
3157 | nfs_put_client(clp); | ||
3156 | } | 3158 | } |
3157 | 3159 | ||
3158 | static void nfs4_renew_done(struct rpc_task *task, void *data) | 3160 | static void nfs4_renew_done(struct rpc_task *task, void *data) |
@@ -3185,6 +3187,8 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred) | |||
3185 | .rpc_cred = cred, | 3187 | .rpc_cred = cred, |
3186 | }; | 3188 | }; |
3187 | 3189 | ||
3190 | if (!atomic_inc_not_zero(&clp->cl_count)) | ||
3191 | return -EIO; | ||
3188 | return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT, | 3192 | return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT, |
3189 | &nfs4_renew_ops, clp); | 3193 | &nfs4_renew_ops, clp); |
3190 | } | 3194 | } |