Skip to content

btrfs-progs: add detection for unexpected file extents

Qu Wenruo linux-btrfs 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5btrfs-progs: corrupt-block: allow inode corruption to use --value optionbtrfs-corrupt-block.c+25 -260 replies
2/5btrfs-progs: corrupt-block: allow dir item corruption to use --value optionbtrfs-corrupt-block.c+4 -40 replies
3/5btrfs-progs: corrupt-block: allow corrupting dir item flagsbtrfs-corrupt-block.c+9 -00 replies
4/5btrfs-progs: check: detect invalid file extent itemscheck/main.c check/mode-lowmem.c+23 -80 replies
5/5btrfs-progs: fsck-test: add a test case for unexpected file extent itemstests/fsck-tests/075-blk-inode-with-data/default.img.xz tests/fsck-tests/075-blk-inode-with-data/test.sh+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] btrfs-progs: add detection for unexpected file extents

There is a kernel patch (*) which mentioned a corrupted fs image where there is at least one file extent item which shouldn't exist, as the inode is not a symlink or regular file.

It turns out btrfs check can not detect such case.

The first 3 patches introduce the ability to generate such image.

The 4th patch adds the detection ability, and the last one is the test case.

*: https://lore.kernel.org/linux-btrfs/[email protected]/

Qu Wenruo (5):
btrfs-progs: corrupt-block: allow inode corruption to use --value
option
btrfs-progs: corrupt-block: allow dir item corruption to use --value
option
btrfs-progs: corrupt-block: allow corrupting dir item flags
btrfs-progs: check: detect invalid file extent items
btrfs-progs: fsck-test: add a test case for unexpected file extent
items

 btrfs-corrupt-block.c                         |  68 ++++++++++--------
 check/main.c                                  |   5 ++
 check/mode-lowmem.c                           |  26 ++++---
 .../075-blk-inode-with-data/default.img.xz    | Bin 0 -> 2104 bytes
 .../075-blk-inode-with-data/test.sh           |  16 +++++
 5 files changed, 77 insertions(+), 38 deletions(-)
 create mode 100644 tests/fsck-tests/075-blk-inode-with-data/default.img.xz
 create mode 100755 tests/fsck-tests/075-blk-inode-with-data/test.sh

--
2.54.0