Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0851de06 authored by Alexandros Batsakis's avatar Alexandros Batsakis Committed by Trond Myklebust
Browse files

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: default avatarAlexandros Batsakis <batsakis@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 7135840f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3152,7 +3152,9 @@ static void nfs4_renew_release(void *data)
{
	struct nfs_client *clp = data;

	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)
@@ -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);
}