* [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps()
@ 2026-02-25 10:36 Mark Harmstone
2026-02-25 11:32 ` Johannes Thumshirn
2026-02-27 0:02 ` David Sterba
0 siblings, 2 replies; 3+ messages in thread
From: Mark Harmstone @ 2026-02-25 10:36 UTC (permalink / raw)
To: linux-btrfs, boris; +Cc: Mark Harmstone, Chris Mason
Fix move_existing_remaps() so that if we increment the slot because the
key we encounter isn't a REMAP_BACKREF, we don't reuse the objectid and
offset of the old item.
Link: https://lore.kernel.org/linux-btrfs/20260125123908.2096548-1-clm@meta.com/
Reported-by: Chris Mason <clm@fb.com>
Fixes: bbea42dfb91f ("btrfs: move existing remaps before relocating block group")
Signed-off-by: Mark Harmstone <mark@harmstone.com>
---
fs/btrfs/relocation.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 5a8644667620..2dee4d708f95 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4394,6 +4394,8 @@ static int move_existing_remaps(struct btrfs_fs_info *fs_info,
leaf = path->nodes[0];
}
+
+ btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
}
remap = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_remap_item);
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps()
2026-02-25 10:36 [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps() Mark Harmstone
@ 2026-02-25 11:32 ` Johannes Thumshirn
2026-02-27 0:02 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: Johannes Thumshirn @ 2026-02-25 11:32 UTC (permalink / raw)
To: Mark Harmstone, linux-btrfs@vger.kernel.org, boris@bur.io; +Cc: Chris Mason
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps()
2026-02-25 10:36 [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps() Mark Harmstone
2026-02-25 11:32 ` Johannes Thumshirn
@ 2026-02-27 0:02 ` David Sterba
1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2026-02-27 0:02 UTC (permalink / raw)
To: Mark Harmstone; +Cc: linux-btrfs, boris, Chris Mason
On Wed, Feb 25, 2026 at 10:36:06AM +0000, Mark Harmstone wrote:
> Fix move_existing_remaps() so that if we increment the slot because the
> key we encounter isn't a REMAP_BACKREF, we don't reuse the objectid and
> offset of the old item.
>
> Link: https://lore.kernel.org/linux-btrfs/20260125123908.2096548-1-clm@meta.com/
> Reported-by: Chris Mason <clm@fb.com>
> Fixes: bbea42dfb91f ("btrfs: move existing remaps before relocating block group")
> Signed-off-by: Mark Harmstone <mark@harmstone.com>
Added to for-next, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-27 0:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 10:36 [PATCH] btrfs: read key again after incrementing slot in move_existing_remaps() Mark Harmstone
2026-02-25 11:32 ` Johannes Thumshirn
2026-02-27 0:02 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox