提交 7ba028af 编写于 作者: D Darrick J. Wong 提交者: Zheng Zengkai

xfs: only bother with sync_filesystem during readonly remount

mainline inclusion
from mainline-v5.16-rc3
commit b97cca3b
category: bugfix
bugzilla: 187526,https://gitee.com/openeuler/kernel/issues/I4KIAO

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

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

In commit 02b9984d, we pushed a sync_filesystem() call from the VFS
into xfs_fs_remount.  The only time that we ever need to push dirty file
data or metadata to disk for a remount is if we're remounting the
filesystem read only, so this really could be moved to xfs_remount_ro.

Once we've moved the call site, actually check the return value from
sync_filesystem.

Fixes: 02b9984d ("fs: push sync_filesystem() down to the file system's remount_fs()")
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NGuo Xuenan <guoxuenan@huawei.com>
Reviewed-by: NZhang Yi <yi.zhang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 5b35283a
......@@ -1774,6 +1774,11 @@ xfs_remount_ro(
};
int error;
/* Flush all the dirty data to disk. */
error = sync_filesystem(mp->m_super);
if (error)
return error;
/*
* Cancel background eofb scanning so it cannot race with the final
* log force+buftarg wait and deadlock the remount.
......@@ -1853,8 +1858,6 @@ xfs_fc_reconfigure(
if (error)
return error;
sync_filesystem(mp->m_super);
/* inode32 -> inode64 */
if ((mp->m_flags & XFS_MOUNT_SMALL_INUMS) &&
!(new_mp->m_flags & XFS_MOUNT_SMALL_INUMS)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册