提交 f0116a19 编写于 作者: T Trond Myklebust 提交者: Zheng Zengkai

NFS: Do not report flush errors in nfs_write_end()

stable inclusion
from stable-v5.10.121
commit 040242365c9e2b2aadf4f40cb4083f42c90ee433
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6CQ

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=040242365c9e2b2aadf4f40cb4083f42c90ee433

--------------------------------

[ Upstream commit d95b2665 ]

If we do flush cached writebacks in nfs_write_end() due to the imminent
expiration of an RPCSEC_GSS session, then we should defer reporting any
resulting errors until the calls to file_check_and_advance_wb_err() in
nfs_file_write() and nfs_file_fsync().

Fixes: 6fbda89b ("NFS: Replace custom error reporting mechanism with generic one")
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 84dccc31
...@@ -387,11 +387,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, ...@@ -387,11 +387,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
return status; return status;
NFS_I(mapping->host)->write_io += copied; NFS_I(mapping->host)->write_io += copied;
if (nfs_ctx_key_to_expire(ctx, mapping->host)) { if (nfs_ctx_key_to_expire(ctx, mapping->host))
status = nfs_wb_all(mapping->host); nfs_wb_all(mapping->host);
if (status < 0)
return status;
}
return copied; return copied;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册