Skip to content

Commit 5833112

Browse files
Christoph Hellwigdjwong
authored andcommitted
xfs: reflink should force the log out if mounted with wsync
Reflink should force the log out to disk if the filesystem was mounted with wsync, the same as most other operations in xfs. [Note: XFS_MOUNT_WSYNC is set when the admin mounts the filesystem with either the 'wsync' or 'sync' mount options, which effectively means that we're classifying reflink/dedupe as IO operations and making them synchronous when required.] Fixes: 3fc9f5e ("xfs: remove xfs_reflink_remap_range") Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Brian Foster <[email protected]> [darrick: add more to the changelog] Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Darrick J. Wong <[email protected]>
1 parent 54fbdd1 commit 5833112

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/xfs/xfs_file.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,11 @@ xfs_file_remap_range(
10591059

10601060
ret = xfs_reflink_update_dest(dest, pos_out + len, cowextsize,
10611061
remap_flags);
1062+
if (ret)
1063+
goto out_unlock;
10621064

1065+
if (mp->m_flags & XFS_MOUNT_WSYNC)
1066+
xfs_log_force_inode(dest);
10631067
out_unlock:
10641068
xfs_reflink_remap_unlock(file_in, file_out);
10651069
if (ret)

0 commit comments

Comments
 (0)