[Devel] [PATCH hci-8.1 v2 5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
Alexey Kuznetsov
kuznet at virtuozzo.com
Tue Nov 17 20:01:01 MSK 2026
We do not allow fast commit on fs used by csd. In case the fs
accidentally has fast_commit feature enabled, just disable
swapext to be on safe side.
Fixes: 1a3d440e7fbc ("fs/ext4: swapext ioctl")
Affects: #VSTOR-155601
https://virtuozzo.atlassian.net/browse/VSTOR-155601
Signed-off-by: Alexey Kuznetsov <kuznet at virtuozzo.com>
Feature: ext4: swapext ioctl: swap range of blocks between two files
---
fs/ext4/move_extent.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index b25f2865df89..fc4ba7547eeb 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -888,6 +888,10 @@ ext4_ioc_swap_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
if (!EXT4_SB(orig_inode->i_sb)->s_journal)
return -EOPNOTSUPP;
+ /* Fast commit cannot log extent swap, so we do not support it */
+ if (test_opt2(orig_inode->i_sb, JOURNAL_FAST_COMMIT))
+ return -EOPNOTSUPP;
+
/* TODO: it's not obvious how to swap blocks for inodes with full
* journaling enabled
*/
--
2.47.1
More information about the Devel
mailing list