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

NFS: fsync() should report filesystem errors over EINTR/ERESTARTSYS

stable inclusion
from stable-v5.10.121
commit c5a0e59bbe0546b2b28ade53c47bf2efb643fb33
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=c5a0e59bbe0546b2b28ade53c47bf2efb643fb33

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

[ Upstream commit 9641d9bc ]

If the commit to disk is interrupted, we should still first check for
filesystem errors so that we can report them in preference to the error
due to the signal.

Fixes: 2197e9b0 ("NFS: Fix up fsync() when the server rebooted")
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>
上级 a1428a5f
......@@ -205,15 +205,16 @@ static int
nfs_file_fsync_commit(struct file *file, int datasync)
{
struct inode *inode = file_inode(file);
int ret;
int ret, ret2;
dprintk("NFS: fsync file(%pD2) datasync %d\n", file, datasync);
nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
ret = nfs_commit_inode(inode, FLUSH_SYNC);
if (ret < 0)
ret2 = file_check_and_advance_wb_err(file);
if (ret2 < 0)
return ret2;
return ret;
return file_check_and_advance_wb_err(file);
}
int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册