Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] btrfs: fix multiple bugs in raid-stripe-tree deletion path
@ 2026-04-13  6:52 robbieko
  2026-04-13  6:52 ` [PATCH 1/6] btrfs: copy devid in btrfs_partially_delete_raid_extent() robbieko
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: robbieko @ 2026-04-13  6:52 UTC (permalink / raw)
  To: linux-btrfs; +Cc: robbieko

This series fixes six bugs in fs/btrfs/raid-stripe-tree.c, all within the
stripe extent deletion and partial deletion code paths.

Patch 1 fixes btrfs_partially_delete_raid_extent() failing to copy the
devid when rebuilding a truncated stripe extent, resulting in zeroed-out
devids and corrupted stripe mappings.

Patch 2 fixes btrfs_delete_raid_extent() using offset=0 for the search
key, which can miss entries when the target is the first item on a leaf.
Changed to offset=(u64)-1 with proper boundary handling.

Patch 3 fixes btrfs_previous_item() being called with min_objectid=start,
which prevents finding the preceding stripe extent whose objectid is less
than start.

Patch 4 replaces an ASSERT(found_start <= start) with proper error
handling that returns -ENOENT, avoiding kernel panics on unexpected
B-tree states.

Patch 5 handles -EAGAIN from btrfs_duplicate_item() in the punch-a-hole
case and refreshes the stale leaf pointer after a potential leaf split.

Patch 6 adds return value checking for all three call sites of
btrfs_partially_delete_raid_extent() to avoid silently losing errors.

robbieko (6):
  btrfs: copy devid in btrfs_partially_delete_raid_extent()
  btrfs: fix raid stripe search missing entries at leaf boundaries
  btrfs: fix wrong min_objectid in btrfs_previous_item() call
  btrfs: replace ASSERT with proper error handling in stripe lookup
    fallback
  btrfs: handle -EAGAIN from btrfs_duplicate_item and refresh stale leaf
    pointer
  btrfs: check return value of btrfs_partially_delete_raid_extent()

 fs/btrfs/raid-stripe-tree.c | 57 +++++++++++++++++++++++++++++--------
 1 file changed, 45 insertions(+), 12 deletions(-)

-- 
2.43.0


Disclaimer: The contents of this e-mail message and any attachments are confidential and are intended solely for addressee. The information may also be legally privileged. This transmission is sent in trust, for the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify the sender by reply e-mail or phone and delete this message and its attachments, if any.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-04-17  2:18 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13  6:52 [PATCH 0/6] btrfs: fix multiple bugs in raid-stripe-tree deletion path robbieko
2026-04-13  6:52 ` [PATCH 1/6] btrfs: copy devid in btrfs_partially_delete_raid_extent() robbieko
2026-04-13  9:14   ` Johannes Thumshirn
2026-04-13  6:52 ` [PATCH 2/6] btrfs: fix raid stripe search missing entries at leaf boundaries robbieko
2026-04-13 10:02   ` Johannes Thumshirn
2026-04-13 19:09   ` David Sterba
2026-04-13  6:52 ` [PATCH 3/6] btrfs: fix wrong min_objectid in btrfs_previous_item() call robbieko
2026-04-13  9:43   ` Johannes Thumshirn
2026-04-13  6:52 ` [PATCH 4/6] btrfs: replace ASSERT with proper error handling in stripe lookup fallback robbieko
2026-04-13  9:49   ` Johannes Thumshirn
2026-04-13 19:06     ` David Sterba
2026-04-13  6:52 ` [PATCH 5/6] btrfs: handle -EAGAIN from btrfs_duplicate_item and refresh stale leaf pointer robbieko
2026-04-13  9:54   ` Johannes Thumshirn
2026-04-13  6:52 ` [PATCH 6/6] btrfs: check return value of btrfs_partially_delete_raid_extent() robbieko
2026-04-13 10:00   ` Johannes Thumshirn
2026-04-13  9:11 ` [PATCH 0/6] btrfs: fix multiple bugs in raid-stripe-tree deletion path Johannes Thumshirn
2026-04-13 19:16 ` David Sterba
2026-04-17  2:18 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox