Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] btrfs: add basic alignment checks for extent_state
@ 2026-07-28  9:11 Qu Wenruo
  2026-07-28  9:11 ` [PATCH v2 1/3] btrfs: use aligned range for locking in extent_fiemap() Qu Wenruo
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Qu Wenruo @ 2026-07-28  9:11 UTC (permalink / raw)
  To: linux-btrfs

[CHANGELOG]
v2:
- Fix a crash caught by generic/136
  Since btrfs allow reflinking the last block until EOF, the range
  passed for btrfs_clone() can be unaligned.

  Fix it by passing aligned range end into btrfs_lock_extent().
  This won't affect the btrfs_clone() call as it doesn't use inclusive
  end.

- Slightly rewords the first patch
  To explain it more clearly that the fix is for btrfs_lock_extent().

Commit 3f255ece2f1e ("btrfs: introduce extra sanity checks for extent
maps") introduced sanity checks for extent maps, but for extent state we
do not have any extra sanity checks.

This series will introduce the check in the 2nd patch, meanwhile the
first one is to fix an exposed unaligned access in extent_fiemap().

Qu Wenruo (3):
  btrfs: use aligned range for locking in extent_fiemap()
  btrfs: use aligned range for locking in reflink
  btrfs: add validation for extent states

 fs/btrfs/extent-io-tree.c | 21 +++++++++++++++++++++
 fs/btrfs/fiemap.c         |  8 ++++----
 fs/btrfs/reflink.c        |  4 ++--
 3 files changed, 27 insertions(+), 6 deletions(-)

-- 
2.54.0


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

end of thread, other threads:[~2026-07-28  9:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28  9:11 [PATCH v2 0/3] btrfs: add basic alignment checks for extent_state Qu Wenruo
2026-07-28  9:11 ` [PATCH v2 1/3] btrfs: use aligned range for locking in extent_fiemap() Qu Wenruo
2026-07-28  9:38   ` Filipe Manana
2026-07-28  9:41     ` Qu Wenruo
2026-07-28  9:50       ` Filipe Manana
2026-07-28  9:11 ` [PATCH v2 2/3] btrfs: use aligned range for locking in reflink Qu Wenruo
2026-07-28  9:46   ` Filipe Manana
2026-07-28  9:11 ` [PATCH v2 3/3] btrfs: add validation for extent states Qu Wenruo
2026-07-28  9:43   ` Filipe Manana

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