Skip to content

Commit b97cca3

Browse files
author
Darrick J. Wong
committed
xfs: only bother with sync_filesystem during readonly remount
In commit 02b9984, 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: 02b9984 ("fs: push sync_filesystem() down to the file system's remount_fs()") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]>
1 parent cea267c commit b97cca3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

fs/xfs/xfs_super.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,6 +1749,11 @@ xfs_remount_ro(
17491749
};
17501750
int error;
17511751

1752+
/* Flush all the dirty data to disk. */
1753+
error = sync_filesystem(mp->m_super);
1754+
if (error)
1755+
return error;
1756+
17521757
/*
17531758
* Cancel background eofb scanning so it cannot race with the final
17541759
* log force+buftarg wait and deadlock the remount.
@@ -1827,8 +1832,6 @@ xfs_fs_reconfigure(
18271832
if (error)
18281833
return error;
18291834

1830-
sync_filesystem(mp->m_super);
1831-
18321835
/* inode32 -> inode64 */
18331836
if (xfs_has_small_inums(mp) && !xfs_has_small_inums(new_mp)) {
18341837
mp->m_features &= ~XFS_FEAT_SMALL_INUMS;

0 commit comments

Comments
 (0)