From: Yichong Chen <chenyichong@uniontech.com>
To: tytso@mit.edu
Cc: adilger.kernel@dilger.ca, libaokun@linux.alibaba.com,
jack@suse.cz, ojaswin@linux.ibm.com, ritesh.list@gmail.com,
yi.zhang@huawei.com, linux-ext4@vger.kernel.org,
linux-kernel@vger.kernel.org,
Yichong Chen <chenyichong@uniontech.com>
Subject: [PATCH] ext4: clear journal restart indication after inserting extent
Date: Wed, 9 Sep 2026 11:35:42 +0800 [thread overview]
Message-ID: <20260909033542.3087876-1-chenyichong@uniontech.com> (raw)
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
next reply other threads:[~2026-09-09 3:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 3:35 Yichong Chen [this message]
2026-09-09 3:49 ` [PATCH] ext4: clear journal restart indication after inserting extent sashiko-bot
2026-09-09 10:36 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260909033542.3087876-1-chenyichong@uniontech.com \
--to=chenyichong@uniontech.com \
--cc=adilger.kernel@dilger.ca \
--cc=jack@suse.cz \
--cc=libaokun@linux.alibaba.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojaswin@linux.ibm.com \
--cc=ritesh.list@gmail.com \
--cc=tytso@mit.edu \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox