diff options
| author | Darrick J. Wong <djwong@kernel.org> | 2022-06-28 11:39:51 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-07-02 16:41:14 +0200 |
| commit | ce6bfe55237e933fa31dad1c85686023ae387249 (patch) | |
| tree | 3c8422e6748fc41b6088cac7a6f56dcc852d62b2 | |
| parent | 3465b167831e9688efa9b5dba44070661b142e22 (diff) | |
| download | linux-ce6bfe55237e933fa31dad1c85686023ae387249.tar.gz linux-ce6bfe55237e933fa31dad1c85686023ae387249.tar.bz2 linux-ce6bfe55237e933fa31dad1c85686023ae387249.zip | |
xfs: only bother with sync_filesystem during readonly remount
[ Upstream commit b97cca3ba9098522e5a1c3388764ead42640c1a5 ]
In commit 02b9984d6408, 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: 02b9984d6408 ("fs: push sync_filesystem() down to the file system's remount_fs()")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | fs/xfs/xfs_super.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 23673703618a..e8d19916ba99 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1773,6 +1773,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. @@ -1851,8 +1856,6 @@ xfs_fs_reconfigure( if (error) return error; - sync_filesystem(mp->m_super); - /* inode32 -> inode64 */ if (xfs_has_small_inums(mp) && !xfs_has_small_inums(new_mp)) { mp->m_features &= ~XFS_FEAT_SMALL_INUMS; |
