This is a note to let you know that I've just added the patch titled xfs: reflink should force the log out if mounted with wsync to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xfs-reflink-should-force-the-log-out-if-mounted-with-wsync.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Wed Oct 26 04:49:40 PM CEST 2022 From: Chandan Babu R <chandan.babu@xxxxxxxxxx> Date: Wed, 26 Oct 2022 11:58:41 +0530 Subject: xfs: reflink should force the log out if mounted with wsync To: gregkh@xxxxxxxxxxxxxxxxxxx Cc: sashal@xxxxxxxxxx, mcgrof@xxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, djwong@xxxxxxxxxx, chandan.babu@xxxxxxxxxx, amir73il@xxxxxxxxx, leah.rumancik@xxxxxxxxx Message-ID: <20221026062843.927600-25-chandan.babu@xxxxxxxxxx> From: Christoph Hellwig <hch@xxxxxx> commit 5833112df7e9a306af9af09c60127b92ed723962 upstream. 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: 3fc9f5e409319 ("xfs: remove xfs_reflink_remap_range") Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx> [darrick: add more to the changelog] Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Acked-by: Darrick J. Wong <djwong@xxxxxxxxxx> Signed-off-by: Chandan Babu R <chandan.babu@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/xfs/xfs_file.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -1044,7 +1044,11 @@ xfs_file_remap_range( ret = xfs_reflink_update_dest(dest, pos_out + len, cowextsize, remap_flags); + if (ret) + goto out_unlock; + if (mp->m_flags & XFS_MOUNT_WSYNC) + xfs_log_force_inode(dest); out_unlock: xfs_reflink_remap_unlock(file_in, file_out); if (ret) Patches currently in stable-queue which might be from chandan.babu@xxxxxxxxxx are queue-5.4/xfs-check-owner-of-dir3-blocks.patch queue-5.4/xfs-throttle-commits-on-delayed-background-cil-push.patch queue-5.4/xfs-factor-common-ail-item-deletion-code.patch queue-5.4/xfs-remove-the-xfs_dq_logitem_t-typedef.patch queue-5.4/xfs-fix-buffer-corruption-reporting-when-xfs_dir3_free_header_check-fails.patch queue-5.4/xfs-xfs_buf_corruption_error-should-take-__this_address.patch queue-5.4/xfs-open-code-insert-range-extent-split-helper.patch queue-5.4/xfs-don-t-write-a-corrupt-unmount-record-to-force-summary-counter-recalc.patch queue-5.4/xfs-check-owner-of-dir3-data-blocks.patch queue-5.4/xfs-factor-out-quotaoff-intent-ail-removal-and-memory-free.patch queue-5.4/xfs-trylock-underlying-buffer-on-dquot-flush.patch queue-5.4/xfs-remove-the-xfs_disk_dquot_t-and-xfs_dquot_t.patch queue-5.4/xfs-add-a-function-to-deal-with-corrupt-buffers-post-verifiers.patch queue-5.4/xfs-fix-use-after-free-on-cil-context-on-shutdown.patch queue-5.4/xfs-tail-updates-only-need-to-occur-when-lsn-changes.patch queue-5.4/xfs-use-scnprintf-for-avoiding-potential-buffer-overflow.patch queue-5.4/xfs-move-inode-flush-to-the-sync-workqueue.patch queue-5.4/xfs-lower-cil-flush-limit-for-large-logs.patch queue-5.4/xfs-rework-collapse-range-into-an-atomic-operation.patch queue-5.4/xfs-remove-the-xfs_qoff_logitem_t-typedef.patch queue-5.4/xfs-fix-unmount-hang-and-memory-leak-on-shutdown-during-quotaoff.patch queue-5.4/xfs-preserve-default-grace-interval-during-quotacheck.patch queue-5.4/xfs-replace-function-declaration-by-actual-definition.patch queue-5.4/xfs-rework-insert-range-into-an-atomic-operation.patch queue-5.4/xfs-factor-out-a-new-xfs_log_force_inode-helper.patch queue-5.4/xfs-reflink-should-force-the-log-out-if-mounted-with-wsync.patch