* [PATCH] ext4: clear journal restart indication after inserting extent
@ 2026-09-09 3:35 Yichong Chen
2026-09-09 10:36 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Yichong Chen @ 2026-09-09 3:35 UTC (permalink / raw)
To: tytso
Cc: adilger.kernel, libaokun, jack, ojaswin, ritesh.list, yi.zhang,
linux-ext4, linux-kernel, Yichong Chen
ext4_datasem_ensure_credits() returns 1 when it successfully restarts
the transaction. finish_range() leaves that value in retval when the
subsequent ext4_ext_insert_extent() succeeds. Its callers interpret any
nonzero return as a migration failure, so they stop building the extent
tree and take the cleanup path instead of completing the migration.
Before ext4_ext_insert_extent() was changed to return a path, its integer
return value overwrote the restart indication. Restore that behavior with
PTR_ERR_OR_ZERO(), preserving insertion errors and returning zero on
success.
Fixes: f7d1331f16a8 ("ext4: get rid of ppath in ext4_ext_insert_extent()")
Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
---
fs/ext4/migrate.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index 5d60ef10fe11..d467b5a13c62 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -53,8 +53,7 @@ static int finish_range(handle_t *handle, struct inode *inode,
if (retval < 0)
goto err_out;
path = ext4_ext_insert_extent(handle, inode, path, &newext, 0);
- if (IS_ERR(path))
- retval = PTR_ERR(path);
+ retval = PTR_ERR_OR_ZERO(path);
err_out:
up_write((&EXT4_I(inode)->i_data_sem));
ext4_free_ext_path(path);
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: clear journal restart indication after inserting extent
2026-09-09 3:35 [PATCH] ext4: clear journal restart indication after inserting extent Yichong Chen
@ 2026-09-09 10:36 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2026-09-09 10:36 UTC (permalink / raw)
To: Yichong Chen
Cc: tytso, adilger.kernel, libaokun, jack, ojaswin, ritesh.list,
yi.zhang, linux-ext4, linux-kernel
On Wed 09-09-26 11:35:42, Yichong Chen wrote:
> ext4_datasem_ensure_credits() returns 1 when it successfully restarts
> the transaction. finish_range() leaves that value in retval when the
> subsequent ext4_ext_insert_extent() succeeds. Its callers interpret any
> nonzero return as a migration failure, so they stop building the extent
> tree and take the cleanup path instead of completing the migration.
>
> Before ext4_ext_insert_extent() was changed to return a path, its integer
> return value overwrote the restart indication. Restore that behavior with
> PTR_ERR_OR_ZERO(), preserving insertion errors and returning zero on
> success.
>
> Fixes: f7d1331f16a8 ("ext4: get rid of ppath in ext4_ext_insert_extent()")
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/migrate.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
> index 5d60ef10fe11..d467b5a13c62 100644
> --- a/fs/ext4/migrate.c
> +++ b/fs/ext4/migrate.c
> @@ -53,8 +53,7 @@ static int finish_range(handle_t *handle, struct inode *inode,
> if (retval < 0)
> goto err_out;
> path = ext4_ext_insert_extent(handle, inode, path, &newext, 0);
> - if (IS_ERR(path))
> - retval = PTR_ERR(path);
> + retval = PTR_ERR_OR_ZERO(path);
> err_out:
> up_write((&EXT4_I(inode)->i_data_sem));
> ext4_free_ext_path(path);
> --
> 2.51.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-09 10:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-09 3:35 [PATCH] ext4: clear journal restart indication after inserting extent Yichong Chen
2026-09-09 10:36 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®