* [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
@ 2026-11-17 16:58 Alexey Kuznetsov
2026-11-17 16:59 ` [Devel] [PATCH hci-8.1 v2 2/5] fs/ext4: ensure ext4 transaction credits while swapext Alexey Kuznetsov
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Alexey Kuznetsov @ 2026-11-17 16:58 UTC (permalink / raw)
To: devel, khorenko, kui.liu, azaitsev
swapext ioctl (like mainstream move_extent) has to have
unorthodox behaviour on error. It can be partial like write()
and then partial success must be returned to calling user.
Unlike write() ioctl really returns an error, but also
ioctl request struct is modified with partial work results.
The fixed version reports correct moved_len to caller even
in case of errors. Now it is guaranteed that area
before moved_len is swapped and area beyond moved_len
is not affected.
Also it fixes bugs: first, when a pass stopped part-way
with ENOSPC or EBUSY and was retried, swapext retried
the already swapped area and failed with ENODATA.
Second, on error swapext left moved_len short or zero, so it
neither discarded preallocations of the inodes nor invalidated
page cache on the swapped area. Not discarding preallocations
could lead to double free of blocks. The same bug was fixed in
mainstream move_extent by 55583e899a53 ("ext4: fix double-free
of blocks due to wrong extents moved_len").
Fixes: 1a3d440e7fbc ("fs/ext4: swapext ioctl")
Affects: #VSTOR-148028, #VSTOR-100610
https://virtuozzo.atlassian.net/browse/VSTOR-100610
https://virtuozzo.atlassian.net/browse/VSTOR-148028
Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
Feature: ext4: swapext ioctl: swap range of blocks between two files
---
fs/ext4/move_extent.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index f08604816892..0e8d1366da7a 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -714,7 +714,7 @@ swap_one_extent(struct file *o_filp, struct inode *donor_inode,
struct inode *orig_inode = file_inode(o_filp);
handle_t *handle;
int jblocks, retries = 0;
- int replaced_count = 0;
+ int rc = 0;
struct super_block *sb = orig_inode->i_sb;
/*
@@ -731,13 +731,13 @@ swap_one_extent(struct file *o_filp, struct inode *donor_inode,
handle = ext4_journal_start(orig_inode, EXT4_HT_MOVE_EXTENTS, jblocks);
if (IS_ERR(handle)) {
*err = PTR_ERR(handle);
- return 0;
+ return rc;
}
ext4_double_down_write_data_sem(orig_inode, donor_inode);
- replaced_count = ext4_swap_extents_2(handle, orig_inode, donor_inode,
- orig_blk, donor_blk, len,
- insn, err, se);
+ rc += ext4_swap_extents_2(handle, orig_inode, donor_inode,
+ orig_blk + rc, donor_blk + rc, len - rc,
+ insn, err, se);
ext4_double_up_write_data_sem(orig_inode, donor_inode);
se->s_dirty += handle->h_requested_credits - handle->h_total_credits;
@@ -752,7 +752,7 @@ swap_one_extent(struct file *o_filp, struct inode *donor_inode,
if (*err == -EBUSY && retries++ < 4 && EXT4_SB(sb)->s_journal &&
jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal))
goto again;
- return replaced_count;
+ return rc;
}
static int
@@ -762,7 +762,7 @@ expose_one_extent(struct inode *donor_inode,
{
handle_t *handle;
int jblocks, retries = 0;
- int replaced_count = 0;
+ int rc = 0;
struct super_block *sb = donor_inode->i_sb;
again:
@@ -771,13 +771,13 @@ expose_one_extent(struct inode *donor_inode,
handle = ext4_journal_start(donor_inode, EXT4_HT_MOVE_EXTENTS, jblocks);
if (IS_ERR(handle)) {
*err = PTR_ERR(handle);
- return 0;
+ return rc;
}
down_write(&EXT4_I(donor_inode)->i_data_sem);
- replaced_count = ext4_expose_extents_2(handle, donor_inode,
- donor_blk, len,
- insn, err, se);
+ rc += ext4_expose_extents_2(handle, donor_inode,
+ donor_blk + rc, len - rc,
+ insn, err, se);
up_write(&EXT4_I(donor_inode)->i_data_sem);
se->s_dirty += handle->h_requested_credits - handle->h_total_credits;
@@ -791,7 +791,7 @@ expose_one_extent(struct inode *donor_inode,
if (*err == -EBUSY && retries++ < 4 && EXT4_SB(sb)->s_journal &&
jbd2_journal_force_commit_nested(EXT4_SB(sb)->s_journal))
goto again;
- return replaced_count;
+ return rc;
}
static unsigned int count_credits(struct inode *inode, ext4_lblk_t start, ext4_lblk_t len,
@@ -974,12 +974,12 @@ ext4_ioc_swap_extents(struct file *o_filp, struct file *d_filp, __u64 orig_blk,
ret = 0;
rc = cur_len;
}
+ se->moved_len += rc;
if (ret < 0)
break;
o_start += rc;
d_start += rc;
}
- se->moved_len = d_start - donor_blk;
out:
if (se->moved_len) {
--
2.47.1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* [Devel] [PATCH hci-8.1 v2 2/5] fs/ext4: ensure ext4 transaction credits while swapext
@ 2026-11-17 16:59 ` Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
0 siblings, 1 reply; 14+ messages in thread
From: Alexey Kuznetsov @ 2026-11-17 16:59 UTC (permalink / raw)
To: devel, khorenko, kui.liu, azaitsev
ext4 (like any other journaling fs) has a problem
with estimating journal reservations required for particular
fs operation. swapext is pretty complicated operation, its
exact volume depends on set of extents currently present
in the inodes.
Credits for the whole request are estimated in advance from the
number of extents in the orig range, but a pass may also split
extents and grow the extent tree of both inodes, so a fragmented
range in an inode with a deep tree can need more than reserved.
When the handle runs out of credits in the middle of a pass,
jbd2_journal_dirty_metadata() fails with -ENOSPC, the handle is
aborted and ext4 reports "journal_dirty_metadata failed" error.
With errors=remount-ro (this option is required for css)
the journal is aborted and the filesystem becomes read-only,
with errors=continue the half-done pass can be committed partially,
which is metadata corruption.
This patch suggests a safe way to adjust credits in case
initial estimate was wrong without fatal impact on journal:
it checks credits before each pass, extends the handle if needed
(the logic is borrowed from ext4_block_write_begin() which
has similar problem), and otherwise restarts the transaction
and continues from the last completed pass.
Note, swapext does not require to swap the whole requested
area. It is allowed to swap any partial contiguous area,
provided moved_len reports swapped blocks and blocks
beyond moved_len are not affected.
Fixes: 1a3d440e7fbc ("fs/ext4: swapext ioctl")
Affects: #VSTOR-148028, #VSTOR-100610
https://virtuozzo.atlassian.net/browse/VSTOR-100610
https://virtuozzo.atlassian.net/browse/VSTOR-148028
Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
Feature: ext4: swapext ioctl: swap range of blocks between two files
---
fs/ext4/extents.c | 34 ++++++++++++++++++++++++++++++++++
fs/ext4/move_extent.c | 6 ++++++
2 files changed, 40 insertions(+)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index eca3f0312ac5..58d3acf6646e 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -5821,6 +5821,7 @@ ext4_swap_extents_2(handle_t *handle, struct inode *inode1,
struct ext4_ext_path *path1 = NULL;
struct ext4_ext_path *path2 = NULL;
int replaced_count = 0;
+ int passes = 0;
BUG_ON(!rwsem_is_locked(&EXT4_I(inode1)->i_data_sem));
BUG_ON(!rwsem_is_locked(&EXT4_I(inode2)->i_data_sem));
@@ -5834,6 +5835,27 @@ ext4_swap_extents_2(handle_t *handle, struct inode *inode1,
int e1_len, e2_len, len;
int split = 0;
+ /*
+ * A pass either splits at most one extent in each inode or
+ * swaps one pair of extents. Running out of credits in the
+ * middle of a pass aborts the journal, so before each pass
+ * (but the first one, which the caller has reserved for) make
+ * sure the handle can afford the worst case. If it cannot,
+ * return to the caller with -EAGAIN, it will restart the
+ * transaction and continue from the current lblk1/lblk2
+ * (the start passed in plus the returned replaced_count).
+ */
+ if (passes++) {
+ int credits = ext4_chunk_trans_blocks(inode1, 1) +
+ ext4_chunk_trans_blocks(inode2, 1);
+ int ret = __ext4_journal_ensure_credits(handle, credits,
+ credits, 0);
+ if (ret) {
+ *erp = ret < 0 ? ret : -EAGAIN;
+ break;
+ }
+ }
+
path1 = ext4_find_extent(inode1, lblk1, NULL, EXT4_EX_NOCACHE);
if (IS_ERR(path1)) {
*erp = PTR_ERR(path1);
@@ -5993,6 +6015,7 @@ ext4_expose_extents_2(handle_t *handle, struct inode *inode,
{
struct ext4_ext_path *path = NULL;
int replaced_count = 0;
+ int passes = 0;
ext4_es_remove_extent(inode, lblk, count);
@@ -6002,6 +6025,17 @@ ext4_expose_extents_2(handle_t *handle, struct inode *inode,
int e_len, len;
int split = 0;
+ /* See comment in ext4_swap_extents_2() */
+ if (passes++) {
+ int credits = ext4_chunk_trans_blocks(inode, 1);
+ int ret = __ext4_journal_ensure_credits(handle, credits,
+ credits, 0);
+ if (ret) {
+ *erp = ret < 0 ? ret : -EAGAIN;
+ break;
+ }
+ }
+
path = ext4_find_extent(inode, lblk, NULL, EXT4_EX_NOCACHE);
if (IS_ERR(path)) {
*erp = PTR_ERR(path);
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 0e8d1366da7a..dfbdb571105f 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -743,6 +743,9 @@ swap_one_extent(struct file *o_filp, struct inode *donor_inode,
se->s_dirty += handle->h_requested_credits - handle->h_total_credits;
ext4_journal_stop(handle);
+ /* Handle is out of credits, continue in a new transaction */
+ if (*err == -EAGAIN)
+ goto again;
if (*err == -ENOSPC &&
ext4_should_retry_alloc(sb, &retries))
goto again;
@@ -782,6 +785,9 @@ expose_one_extent(struct inode *donor_inode,
se->s_dirty += handle->h_requested_credits - handle->h_total_credits;
ext4_journal_stop(handle);
+ /* Handle is out of credits, continue in a new transaction */
+ if (*err == -EAGAIN)
+ goto again;
if (*err == -ENOSPC &&
ext4_should_retry_alloc(sb, &retries))
goto again;
--
2.47.1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Devel] [PATCH hci-8.1 v2 2/5] fs/ext4: ensure ext4 transaction credits while swapext
2026-11-17 16:59 ` [Devel] [PATCH hci-8.1 v2 2/5] fs/ext4: ensure ext4 transaction credits while swapext Alexey Kuznetsov
@ 2026-11-18 10:55 ` Konstantin Khorenko
0 siblings, 0 replies; 14+ messages in thread
From: Konstantin Khorenko @ 2026-11-18 10:55 UTC (permalink / raw)
To: Alexey Kuznetsov; +Cc: azaitsev, devel, kui.liu
Applying with these fixes on my side:
- "Credits for the whole request" -> "Credits for each donor extent":
swap_one_extent() estimates them per donor extent
- after the "Note" paragraph: "Each transaction holds whole passes,
so after a crash the swapped part is a contiguous prefix of the
range as well. The restart continues from the end of the swapped
part, which relies on the previous patch."
On Wed, 18 Nov 2026 00:59:08 +0800, Alexey Kuznetsov wrote:
> Note, swapext does not require to swap the whole requested
> area. It is allowed to swap any partial contiguous area,
> provided moved_len reports swapped blocks and blocks
> beyond moved_len are not affected.
This answers item 5 of my v1 reply for an error return. The added
sentence covers the crash between two transactions, which I asked
about, and the dependency on patch 1 from item 4.
Thanks.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Devel] [PATCH hci-8.1 v2 3/5] fs/ext4: assert presence of journal for swapext
@ 2026-11-17 16:59 ` Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
0 siblings, 1 reply; 14+ messages 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] 14+ messages in thread* [Devel] [PATCH hci-8.1 v2 4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN
@ 2026-11-17 17:00 ` Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
0 siblings, 1 reply; 14+ messages in thread
From: Alexey Kuznetsov @ 2026-11-17 17:00 UTC (permalink / raw)
To: devel, khorenko, kui.liu, azaitsev
Cap amount of credits allocated for transaction handle
to avoid failure on large fragmented ranges.
Note, this fix is possible due to previous patch
"fs/ext4: ensure ext4 transaction credits while swapext",
which allows to split swapext over multiple transactions.
Note, this is not necessary for expose_one_extent(),
credits required always fit to the limit.
Fixes: 1a3d440e7fbc ("fs/ext4: swapext ioctl")
Affects: #VSTOR-155600
https://virtuozzo.atlassian.net/browse/VSTOR-155600
Signed-off-by: Alexey Kuznetsov <kuznet@virtuozzo.com>
Feature: ext4: swapext ioctl: swap range of blocks between two files
---
fs/ext4/move_extent.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index cd07efaa1f30..b25f2865df89 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -728,6 +728,22 @@ swap_one_extent(struct file *o_filp, struct inode *donor_inode,
* fragmented area, up to len pages.
*/
jblocks = ext4_chunk_trans_blocks(donor_inode, len) + nexts;
+ /*
+ * nexts grows with fragmentation of the orig range and can exceed
+ * the maximal handle size, then the handle cannot be started at all.
+ * Cap it: ext4_swap_extents_2() checks credits before every pass but
+ * the first one and returns -EAGAIN to continue in a new transaction.
+ */
+ if (EXT4_SB(sb)->s_journal) {
+ journal_t *journal = EXT4_SB(sb)->s_journal;
+ int limit = (journal->j_max_transaction_buffers -
+ journal->j_transaction_overhead_buffers) / 2;
+
+ jblocks = min(jblocks, limit);
+ }
+ /* The first pass is not checked, it must always be covered */
+ jblocks = max(jblocks, ext4_chunk_trans_blocks(donor_inode, 1) +
+ ext4_chunk_trans_blocks(orig_inode, 1));
handle = ext4_journal_start(orig_inode, EXT4_HT_MOVE_EXTENTS, jblocks);
if (IS_ERR(handle)) {
*err = PTR_ERR(handle);
--
2.47.1
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* [Devel] [PATCH hci-8.1 v2 5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
@ 2026-11-17 17:01 ` Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
0 siblings, 1 reply; 14+ messages in thread
From: Alexey Kuznetsov @ 2026-11-17 17:01 UTC (permalink / raw)
To: devel, khorenko, kui.liu, azaitsev
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@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
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
2026-11-17 16:58 [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error Alexey Kuznetsov
` (3 preceding siblings ...)
2026-11-17 17:01 ` [Devel] [PATCH hci-8.1 v2 5/5] fs/ext4: do not permit swapext on fs with fast commit enabled Alexey Kuznetsov
@ 2026-11-18 10:55 ` Konstantin Khorenko
2026-11-18 10:55 ` Konstantin Khorenko
5 siblings, 0 replies; 14+ messages in thread
From: Konstantin Khorenko @ 2026-11-18 10:55 UTC (permalink / raw)
To: Alexey Kuznetsov; +Cc: azaitsev, devel, kui.liu
Applying with these fixes on my side:
- the retry bug: without UNWRITE_DONOR the retry swapped the done part
back and reported the whole range as moved; -ENODATA only came with
UNWRITE_DONOR
- "by 55583e899a53" -> "by commit 55583e899a53"
- the "Affects:" line dropped, the tracker URLs stay (the same on all
five patches)
On Wed, 18 Nov 2026 00:58:14 +0800, Alexey Kuznetsov wrote:
> Also it fixes bugs: first, when a pass stopped part-way
> with ENOSPC or EBUSY and was retried, swapext retried
> the already swapped area and failed with ENODATA.
Items 1-3 and 6 of my v1 reply are done, thanks.
Thanks.
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
2026-11-17 16:58 [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error Alexey Kuznetsov
` (4 preceding siblings ...)
2026-11-18 10:55 ` [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error Konstantin Khorenko
@ 2026-11-18 10:55 ` Konstantin Khorenko
2026-11-18 15:04 ` Konstantin Khorenko
5 siblings, 1 reply; 14+ messages in thread
From: Konstantin Khorenko @ 2026-11-18 10:55 UTC (permalink / raw)
To: devel, kui.liu, azaitsev, Alexey Kuznetsov
On Wed, 18 Nov 2026 00:58:14 +0800, Alexey Kuznetsov wrote:
> fs/ext4: rectify behaviour of swapext ioctl on error
Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.3.vz10, thanks!
[1/5] fs/ext4: rectify behaviour of swapext ioctl on error
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/68931b3a211e
[2/5] fs/ext4: ensure ext4 transaction credits while swapext
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e0662f4ecece
[3/5] fs/ext4: assert presence of journal for swapext
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/0bb204f536ac
[4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/dc71e1b983cf
[5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/32179ec65a81
--
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
2026-11-18 10:55 ` Konstantin Khorenko
@ 2026-11-18 15:04 ` Konstantin Khorenko
2026-11-18 19:43 ` Konstantin Khorenko
0 siblings, 1 reply; 14+ messages in thread
From: Konstantin Khorenko @ 2026-11-18 15:04 UTC (permalink / raw)
To: devel, kui.liu, azaitsev, Alexey Kuznetsov
All these patches will appear in hci 8.1 as well,
in the rh10-6.12.0-211.75.1.24.3.vz10 kernel.
--
Best regards,
Konstantin Khorenko,
Virtuozzo Linux Kernel Team
On 11/18/26 11:55, Konstantin Khorenko wrote:
> On Wed, 18 Nov 2026 00:58:14 +0800, Alexey Kuznetsov wrote:
>> fs/ext4: rectify behaviour of swapext ioctl on error
>
> Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.3.vz10, thanks!
>
> [1/5] fs/ext4: rectify behaviour of swapext ioctl on error
> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/68931b3a211e
> [2/5] fs/ext4: ensure ext4 transaction credits while swapext
> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e0662f4ecece
> [3/5] fs/ext4: assert presence of journal for swapext
> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/0bb204f536ac
> [4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN
> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/dc71e1b983cf
> [5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/32179ec65a81
>
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
2026-11-18 15:04 ` Konstantin Khorenko
@ 2026-11-18 19:43 ` Konstantin Khorenko
2026-11-19 10:59 ` Alexey Kuznetsov
0 siblings, 1 reply; 14+ messages in thread
From: Konstantin Khorenko @ 2026-11-18 19:43 UTC (permalink / raw)
To: Alexey Kuznetsov; +Cc: devel, kui.liu, azaitsev
On 11/18/26 16:04, Konstantin Khorenko wrote:
> All these patches will appear in hci 8.1 as well,
> in the rh10-6.12.0-211.75.1.24.3.vz10 kernel.
>
> --
> Best regards,
>
> Konstantin Khorenko,
> Virtuozzo Linux Kernel Team
>
> On 11/18/26 11:55, Konstantin Khorenko wrote:
>> On Wed, 18 Nov 2026 00:58:14 +0800, Alexey Kuznetsov wrote:
>>> fs/ext4: rectify behaviour of swapext ioctl on error
>>
>> Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.3.vz10, thanks!
>>
>> [1/5] fs/ext4: rectify behaviour of swapext ioctl on error
>> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/68931b3a211e
>> [2/5] fs/ext4: ensure ext4 transaction credits while swapext
>> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e0662f4ecece
>> [3/5] fs/ext4: assert presence of journal for swapext
>> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/0bb204f536ac
>> [4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN
>> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/dc71e1b983cf
>> [5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
>> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/32179ec65a81
May be write a kselftest for this functionality?
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error
2026-11-18 19:43 ` Konstantin Khorenko
@ 2026-11-19 10:59 ` Alexey Kuznetsov
0 siblings, 0 replies; 14+ messages in thread
From: Alexey Kuznetsov @ 2026-11-19 10:59 UTC (permalink / raw)
To: Konstantin Khorenko; +Cc: devel, kui.liu, azaitsev
Hello!
It would not make much sense. It is very loaded ioctl, every vstorage write
executes this ioctl and vstorage tests cover every aspect of this.
Coverage is not excatly 100%, uncovered areas still exist:
f.e. ENOSPC while allocating blocks for btree is an event which
is never tirggered, but this thing must be covered by vstorage tests as well,
its absence is a fundamental bug in our test suite, and it is not
specific to ioctl, the whole ENOSPC aspect is completely missed.
On Thu, Nov 19, 2026 at 3:56 AM Konstantin Khorenko
<khorenko@virtuozzo.com> wrote:
>
> On 11/18/26 16:04, Konstantin Khorenko wrote:
> > All these patches will appear in hci 8.1 as well,
> > in the rh10-6.12.0-211.75.1.24.3.vz10 kernel.
> >
> > --
> > Best regards,
> >
> > Konstantin Khorenko,
> > Virtuozzo Linux Kernel Team
> >
> > On 11/18/26 11:55, Konstantin Khorenko wrote:
> >> On Wed, 18 Nov 2026 00:58:14 +0800, Alexey Kuznetsov wrote:
> >>> fs/ext4: rectify behaviour of swapext ioctl on error
> >>
> >> Applied to branch-rh10-6.12.0-211.75.1.26.x.vz10-ovz, will be released in rh10-6.12.0-211.75.1.26.3.vz10, thanks!
> >>
> >> [1/5] fs/ext4: rectify behaviour of swapext ioctl on error
> >> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/68931b3a211e
> >> [2/5] fs/ext4: ensure ext4 transaction credits while swapext
> >> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/e0662f4ecece
> >> [3/5] fs/ext4: assert presence of journal for swapext
> >> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/0bb204f536ac
> >> [4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN
> >> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/dc71e1b983cf
> >> [5/5] fs/ext4: do not permit swapext on fs with fast commit enabled
> >> https://bitbucket.org/virtuozzocore/vzkernel.vzs/commits/32179ec65a81
> May be write a kselftest for this functionality?
_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-11-19 11:01 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17 16:58 [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error Alexey Kuznetsov
2026-11-17 16:59 ` [Devel] [PATCH hci-8.1 v2 2/5] fs/ext4: ensure ext4 transaction credits while swapext Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
2026-11-17 16:59 ` [Devel] [PATCH hci-8.1 v2 3/5] fs/ext4: assert presence of journal for swapext Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
2026-11-17 17:00 ` [Devel] [PATCH hci-8.1 v2 4/5] fs/ext4: the swapext ioctl could fail with -ENOSPC and a jbd2 WARN Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
2026-11-17 17:01 ` [Devel] [PATCH hci-8.1 v2 5/5] fs/ext4: do not permit swapext on fs with fast commit enabled Alexey Kuznetsov
2026-11-18 10:55 ` Konstantin Khorenko
2026-11-18 10:55 ` [Devel] [PATCH hci-8.1 v2 1/5] fs/ext4: rectify behaviour of swapext ioctl on error Konstantin Khorenko
2026-11-18 10:55 ` Konstantin Khorenko
2026-11-18 15:04 ` Konstantin Khorenko
2026-11-18 19:43 ` Konstantin Khorenko
2026-11-19 10:59 ` Alexey Kuznetsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox