diff options
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 419f8c44429e..15878404aa8c 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -256,7 +256,7 @@ int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred) | |||
256 | goto out; | 256 | goto out; |
257 | set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | 257 | set_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); |
258 | do_confirm: | 258 | do_confirm: |
259 | status = nfs4_proc_create_session(clp); | 259 | status = nfs4_proc_create_session(clp, cred); |
260 | if (status != 0) | 260 | if (status != 0) |
261 | goto out; | 261 | goto out; |
262 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); | 262 | clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); |
@@ -1717,10 +1717,12 @@ void nfs41_handle_sequence_flag_errors(struct nfs_client *clp, u32 flags) | |||
1717 | 1717 | ||
1718 | static int nfs4_reset_session(struct nfs_client *clp) | 1718 | static int nfs4_reset_session(struct nfs_client *clp) |
1719 | { | 1719 | { |
1720 | struct rpc_cred *cred; | ||
1720 | int status; | 1721 | int status; |
1721 | 1722 | ||
1722 | nfs4_begin_drain_session(clp); | 1723 | nfs4_begin_drain_session(clp); |
1723 | status = nfs4_proc_destroy_session(clp->cl_session); | 1724 | cred = nfs4_get_exchange_id_cred(clp); |
1725 | status = nfs4_proc_destroy_session(clp->cl_session, cred); | ||
1724 | if (status && status != -NFS4ERR_BADSESSION && | 1726 | if (status && status != -NFS4ERR_BADSESSION && |
1725 | status != -NFS4ERR_DEADSESSION) { | 1727 | status != -NFS4ERR_DEADSESSION) { |
1726 | status = nfs4_recovery_handle_error(clp, status); | 1728 | status = nfs4_recovery_handle_error(clp, status); |
@@ -1728,7 +1730,7 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1728 | } | 1730 | } |
1729 | 1731 | ||
1730 | memset(clp->cl_session->sess_id.data, 0, NFS4_MAX_SESSIONID_LEN); | 1732 | memset(clp->cl_session->sess_id.data, 0, NFS4_MAX_SESSIONID_LEN); |
1731 | status = nfs4_proc_create_session(clp); | 1733 | status = nfs4_proc_create_session(clp, cred); |
1732 | if (status) { | 1734 | if (status) { |
1733 | status = nfs4_recovery_handle_error(clp, status); | 1735 | status = nfs4_recovery_handle_error(clp, status); |
1734 | goto out; | 1736 | goto out; |
@@ -1742,6 +1744,8 @@ static int nfs4_reset_session(struct nfs_client *clp) | |||
1742 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) | 1744 | if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) |
1743 | nfs41_setup_state_renewal(clp); | 1745 | nfs41_setup_state_renewal(clp); |
1744 | out: | 1746 | out: |
1747 | if (cred) | ||
1748 | put_rpccred(cred); | ||
1745 | return status; | 1749 | return status; |
1746 | } | 1750 | } |
1747 | 1751 | ||