Skip to content

btrfs: add basic alignment checks for extent_state

Qu Wenruo linux-btrfs 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 5 repliesIn review
  2. v12 patches 7 repliesSuperseded

Changes in v2 from the cover letter

- 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.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: use aligned range for locking in extent_fiemap()fs/btrfs/fiemap.c+4 -43 replies
2/3btrfs: use aligned range for locking in reflinkfs/btrfs/reflink.c+2 -21 reply
3/3btrfs: add validation for extent statesfs/btrfs/extent-io-tree.c+21 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchFilipe Manana
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] btrfs: add basic alignment checks for extent_state

[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(-)
Signature · 1 line
2.54.0