Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: defrag related to corncer case handling
@ 2026-11-16 21:29 Qu Wenruo
  2026-11-16 21:29 ` [PATCH 1/2] btrfs: defrag: break the loop early in defrag_get_extent() Qu Wenruo
  2026-11-16 21:29 ` [PATCH 2/2] btrfs: defrag: fix missed extent when the lookup lands on the next inode Qu Wenruo
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2026-11-16 21:29 UTC (permalink / raw)
  To: linux-btrfs

The first one is a Sashiko report that we can step into the next inode
and continue looping unnecessarily. Fix it by re-ordering the checks.

The second one is another minor corner case where if the defrag range
starts inside the last extent, we may skip a valid defrag target.
Fix it by doing the backward search properly.

Qu Wenruo (2):
  btrfs: defrag: break the loop early in defrag_get_extent()
  btrfs: defrag: fix missed extent when the lookup lands on the next
    inode

 fs/btrfs/defrag.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

-- 
2.56.0


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

end of thread, other threads:[~2026-11-16 21:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 21:29 [PATCH 0/2] btrfs: defrag related to corncer case handling Qu Wenruo
2026-11-16 21:29 ` [PATCH 1/2] btrfs: defrag: break the loop early in defrag_get_extent() Qu Wenruo
2026-11-16 21:29 ` [PATCH 2/2] btrfs: defrag: fix missed extent when the lookup lands on the next inode Qu Wenruo

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