]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: force the log after remapping a synchronous-writes file
authorChandan Babu R <chandan.babu@oracle.com>
Mon, 31 Oct 2022 04:53:54 +0000 (10:23 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:56:54 +0000 (23:56 +0900)
commit96c71d1aacc054c838cfda5b82ad44563f12dacb
tree474a08f552b1ed73894157507c710ccd05654020
parentbb93d306a0e9bd491d804ac85e29c0c1bd410d4b
xfs: force the log after remapping a synchronous-writes file

From: "Darrick J. Wong" <darrick.wong@oracle.com>

commit cc42af7f9fccb684adb14177bbc7ee5c1f37b96c upstream.

Commit 9700dd3e35d4 tried to make it so that a remap operation would
force the log out to disk if the filesystem is mounted with mandatory
synchronous writes.  Unfortunately, that commit failed to handle the
case where the inode or the file descriptor require mandatory
synchronous writes.

Refactor the check into into a helper that will look for all three
conditions, and now we can treat reflink just like any other synchronous
write.

Fixes: 9700dd3e35d4 ("xfs: reflink should force the log out if mounted with wsync")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_file.c