Skip to content

btrfs-progs: check: Detect invalid dev extents and device items

Qu Wenruo linux-btrfs 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 8 repliesIn review
  2. v25 patches 0 repliesSuperseded
  3. v15 patches 3 repliesSuperseded

Changes in v3 from the cover letter

Add btrfs-image fixes to make test cases happy.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6btrfs-progs: image: Use correct device size when restoringimage/main.c+45 -32 replies
2/6btrfs-progs: lowmem check: Add check for overlapping dev extentscheck/mode-lowmem.c+32 -21 reply
3/6btrfs-progs: original check: Add ability to detect bad dev extentscheck/main.c+99 -01 reply
4/6btrfs-progs: lowmem check: Add dev_item check for used bytes and total bytescheck/mode-lowmem.c+5 -03 replies
5/6btrfs-progs: original check: Add dev_item check for used bytes and total bytescheck/main.c+6 -00 replies
6/6btrfs-progs: fsck-tests: Add test image for dev extents beyond device boundarytests/fsck-tests/036-bad-dev-extents/over_dev_boundary.img.xz tests/fsck-tests/036-bad-dev-extents/test.sh+20 -00 replies

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by.

PatchSu YueNikolay Borisov
1/6R-b
2/6R-b
3/6R-b
4/6
5/6
6/6

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

Read the v3 thread

Cover letter [PATCH v3 0/6] btrfs-progs: check: Detect invalid dev extents and device items

This patchset can be fetch from github:
https://github.com/adam900710/btrfs-progs/tree/dev_extents_check

Hans van Kranenburg reported a case where btrfs DUP chunk allocator could allocate invalid dev extents, either overlaps with existing dev extents or beyond device boundary.

This patchset enhances the btrfs-progs side to detect such problems. With hand crafted test image for it.

Changelog:
v2:
Fix a bug in the 1st patch which makes lowmem mode never checks overlap dev extents.
Fix test case bug which never passes due to wrong script.
v3:
Add btrfs-image fixes to make test cases happy.

Qu Wenruo (6):
btrfs-progs: image: Use correct device size when restoring
btrfs-progs: lowmem check: Add check for overlapping dev extents
btrfs-progs: original check: Add ability to detect bad dev extents
btrfs-progs: lowmem check: Add dev_item check for used bytes and total
bytes
btrfs-progs: original check: Add dev_item check for used bytes and
total bytes
btrfs-progs: fsck-tests: Add test image for dev extents beyond device
boundary

 check/main.c                                  | 105 ++++++++++++++++++
 check/mode-lowmem.c                           |  39 ++++++-
 image/main.c                                  |  48 +++++++-
 .../over_dev_boundary.img.xz                  | Bin 0 -> 1640 bytes
 tests/fsck-tests/036-bad-dev-extents/test.sh  |  20 ++++
 5 files changed, 207 insertions(+), 5 deletions(-)
 create mode 100644 tests/fsck-tests/036-bad-dev-extents/over_dev_boundary.img.xz
 create mode 100755 tests/fsck-tests/036-bad-dev-extents/test.sh
Signature · 1 line
2.19.1