[PATCH openEuler-1.0-LTS] NFSv4: Fail mounts if the lease setup times out

From: Trond Myklebust <trond.myklebust@hammerspace.com> mainline inclusion from mainline-v6.12-rc1 commit af94dca79b1296a6db7b8b47cd43be8e94fce8bb category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICMK5J Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?i... -------------------------------- If the server is down when the client is trying to mount, so that the calls to exchange_id or create_session fail, then we should allow the mount system call to fail rather than hang and block other mount/umount calls. Reported-by: Oleksandr Tymoshenko <ovt@google.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com> Conflicts: fs/nfs/nfs4state.c [Commit 67e7b52d44e3 ("NFSv4: Ensure state recovery handles ETIMEDOUT correctly") removed -ETIMEDOUT from nfs4_handle_reclaim_lease_error.] Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com> --- fs/nfs/nfs4state.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 4a06e5ae0cba..5411847cb820 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1955,9 +1955,13 @@ static int nfs4_handle_reclaim_lease_error(struct nfs_client *clp, int status) nfs_mark_client_ready(clp, -EPERM); clear_bit(NFS4CLNT_LEASE_CONFIRM, &clp->cl_state); return -EPERM; + case -ETIMEDOUT: + if (clp->cl_cons_state == NFS_CS_SESSION_INITING) { + nfs_mark_client_ready(clp, -EIO); + return -EIO; + } case -EACCES: case -NFS4ERR_DELAY: - case -ETIMEDOUT: case -EAGAIN: ssleep(1); break; -- 2.31.1

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17843 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/N4R... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17843 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/N4R...
participants (2)
-
Li Lingfeng
-
patchwork bot