diff options
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ff0c080db59b..6917311f201c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2040,15 +2040,9 @@ static int _nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | |||
2040 | .rpc_argp = &args, | 2040 | .rpc_argp = &args, |
2041 | .rpc_resp = &res, | 2041 | .rpc_resp = &res, |
2042 | }; | 2042 | }; |
2043 | int status; | ||
2044 | 2043 | ||
2045 | nfs_fattr_init(info->fattr); | 2044 | nfs_fattr_init(info->fattr); |
2046 | status = nfs4_recover_expired_lease(server); | 2045 | return nfs4_call_sync(server, &msg, &args, &res, 0); |
2047 | if (!status) | ||
2048 | status = nfs4_check_client_ready(server->nfs_client); | ||
2049 | if (!status) | ||
2050 | status = nfs4_call_sync(server, &msg, &args, &res, 0); | ||
2051 | return status; | ||
2052 | } | 2046 | } |
2053 | 2047 | ||
2054 | static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, | 2048 | static int nfs4_lookup_root(struct nfs_server *server, struct nfs_fh *fhandle, |
@@ -4099,15 +4093,23 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request) | |||
4099 | if (request->fl_start < 0 || request->fl_end < 0) | 4093 | if (request->fl_start < 0 || request->fl_end < 0) |
4100 | return -EINVAL; | 4094 | return -EINVAL; |
4101 | 4095 | ||
4102 | if (IS_GETLK(cmd)) | 4096 | if (IS_GETLK(cmd)) { |
4103 | return nfs4_proc_getlk(state, F_GETLK, request); | 4097 | if (state != NULL) |
4098 | return nfs4_proc_getlk(state, F_GETLK, request); | ||
4099 | return 0; | ||
4100 | } | ||
4104 | 4101 | ||
4105 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) | 4102 | if (!(IS_SETLK(cmd) || IS_SETLKW(cmd))) |
4106 | return -EINVAL; | 4103 | return -EINVAL; |
4107 | 4104 | ||
4108 | if (request->fl_type == F_UNLCK) | 4105 | if (request->fl_type == F_UNLCK) { |
4109 | return nfs4_proc_unlck(state, cmd, request); | 4106 | if (state != NULL) |
4107 | return nfs4_proc_unlck(state, cmd, request); | ||
4108 | return 0; | ||
4109 | } | ||
4110 | 4110 | ||
4111 | if (state == NULL) | ||
4112 | return -ENOLCK; | ||
4111 | do { | 4113 | do { |
4112 | status = nfs4_proc_setlk(state, cmd, request); | 4114 | status = nfs4_proc_setlk(state, cmd, request); |
4113 | if ((status != -EAGAIN) || IS_SETLK(cmd)) | 4115 | if ((status != -EAGAIN) || IS_SETLK(cmd)) |
@@ -4793,6 +4795,22 @@ int nfs4_proc_destroy_session(struct nfs4_session *session) | |||
4793 | return status; | 4795 | return status; |
4794 | } | 4796 | } |
4795 | 4797 | ||
4798 | int nfs4_init_session(struct nfs_server *server) | ||
4799 | { | ||
4800 | struct nfs_client *clp = server->nfs_client; | ||
4801 | int ret; | ||
4802 | |||
4803 | if (!nfs4_has_session(clp)) | ||
4804 | return 0; | ||
4805 | |||
4806 | clp->cl_session->fc_attrs.max_rqst_sz = server->wsize; | ||
4807 | clp->cl_session->fc_attrs.max_resp_sz = server->rsize; | ||
4808 | ret = nfs4_recover_expired_lease(server); | ||
4809 | if (!ret) | ||
4810 | ret = nfs4_check_client_ready(clp); | ||
4811 | return ret; | ||
4812 | } | ||
4813 | |||
4796 | /* | 4814 | /* |
4797 | * Renew the cl_session lease. | 4815 | * Renew the cl_session lease. |
4798 | */ | 4816 | */ |