提交 01edbcae 编写于 作者: D Darrick J. Wong 提交者: Zheng Zengkai

xfs: return errors in xfs_fs_sync_fs

mainline inclusion
from mainline-v5.17-rc1
commit 2d86293c
category: bugfix
bugzilla: 186909,https://gitee.com/openeuler/kernel/issues/I4KIAO

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2d86293c70750e4331e9616aded33ab6b47c299d

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

Now that the VFS will do something with the return values from
->sync_fs, make ours pass on error codes.
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NJan Kara <jack@suse.cz>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
Acked-by: NChristian Brauner <brauner@kernel.org>
Signed-off-by: NGuo Xuenan <guoxuenan@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 abddce1a
...@@ -729,6 +729,7 @@ xfs_fs_sync_fs( ...@@ -729,6 +729,7 @@ xfs_fs_sync_fs(
int wait) int wait)
{ {
struct xfs_mount *mp = XFS_M(sb); struct xfs_mount *mp = XFS_M(sb);
int error;
trace_xfs_fs_sync_fs(mp, __return_address); trace_xfs_fs_sync_fs(mp, __return_address);
...@@ -738,7 +739,10 @@ xfs_fs_sync_fs( ...@@ -738,7 +739,10 @@ xfs_fs_sync_fs(
if (!wait) if (!wait)
return 0; return 0;
xfs_log_force(mp, XFS_LOG_SYNC); error = xfs_log_force(mp, XFS_LOG_SYNC);
if (error)
return error;
if (laptop_mode) { if (laptop_mode) {
/* /*
* The disk must be active because we're syncing. * The disk must be active because we're syncing.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册