* [PATCH] btrfs: relocation: release path on copy failure in move_existing_remap()
@ 2026-11-12 21:57 Qu Wenruo
2026-11-17 6:14 ` Johannes Thumshirn
0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2026-11-12 21:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: Sashiko
All other error exits in move_existing_remap() release the path before
jumping to the end label, but the copy_remapped_data() failure doesn't.
The remap root leaf stays write locked until the caller frees the path,
across the transaction abort.
Release the path before jumping to the error path like the others.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/bug/linux-a9bb6565-ee24-429b-a2d7-ab427317fa57
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/relocation.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 9af207446848..94eda599b97b 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4345,8 +4345,10 @@ static int move_existing_remap(struct btrfs_fs_info *fs_info,
}
ret = copy_remapped_data(fs_info, new_addr, dest_addr, dest_length);
- if (unlikely(ret))
+ if (unlikely(ret)) {
+ btrfs_release_path(path);
goto end;
+ }
/* Change data of old remap entry. */
leaf = path->nodes[0];
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-17 6:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 21:57 [PATCH] btrfs: relocation: release path on copy failure in move_existing_remap() Qu Wenruo
2026-11-17 6:14 ` Johannes Thumshirn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox