* [Devel] [PATCH hci-8.1 v2 3/5] fs/ext4: assert presence of journal for swapext
@ 2026-11-17 16:59 Alexey Kuznetsov
0 siblings, 0 replies; only message in thread
From: Alexey Kuznetsov @ 2026-11-17 16:59 UTC (permalink / raw)
To: devel, khorenko, kui.liu, azaitsev
On fs w/o journal swapext would crash f.e. dereferencing
fake journal handle. Actually, the whole swapext
does not make sense without journal.
Fixes: 1a3d440e7fbc ("fs/ext4: swapext ioctl")
Affects: #VSTOR-155599
https://virtuozzo.atlassian.net/browse/VSTOR-155599
Signed-off-by: Alexey Kuznetsov <kuznet@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 dfbdb571105f..cd07efaa1f30 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -868,6 +868,10 @@ ext4_ioc_swap_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
if (!S_ISREG(orig_inode->i_mode) || !S_ISREG(donor_inode->i_mode))
return -EINVAL;
+ /* Do not even try to do atomic swap w/o journal */
+ if (!EXT4_SB(orig_inode->i_sb)->s_journal)
+ return -EOPNOTSUPP;
+
/* TODO: it's not obvious how to swap blocks for inodes with full
* journaling enabled
*/
--
2.47.1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-17 17:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 16:59 [Devel] [PATCH hci-8.1 v2 3/5] fs/ext4: assert presence of journal for swapext Alexey Kuznetsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox