Skip to content

Commit

Permalink
NFSv4.1: Adjust CREATE_SESSION arguments when mounting a new filesystem
Browse files Browse the repository at this point in the history
If we're mounting a new filesystem, ensure that the session has negotiated
large enough request and reply sizes to match the wsize and rsize mount
arguments.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Nov 21, 2012
1 parent ae72ae6 commit 688a902
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6037,9 +6037,22 @@ int nfs4_init_session(struct nfs_server *server)
session->fc_attrs.max_rqst_sz = target_max_rqst_sz;
session->fc_target_max_resp_sz = target_max_resp_sz;
session->fc_attrs.max_resp_sz = target_max_resp_sz;
} else {
/* Just adjust the targets */
if (target_max_rqst_sz > session->fc_target_max_rqst_sz) {
session->fc_target_max_rqst_sz = target_max_rqst_sz;
set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state);
}
if (target_max_resp_sz > session->fc_target_max_resp_sz) {
session->fc_target_max_resp_sz = target_max_resp_sz;
set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state);
}
}
spin_unlock(&clp->cl_lock);

if (test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state))
nfs4_schedule_lease_recovery(clp);

return nfs41_check_session_ready(clp);
}

Expand Down

0 comments on commit 688a902

Please sign in to comment.