btrfs: check: Check and repair invalid free space cahce inode mode
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest7 patches 0 repliesNew
- v17 patches 13 repliesSuperseded
Changes in v2 from the cover letter
- Minor refactor to make common code more common.
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | btrfs-progs: check/lowmem: Add inode mode checkcheck/ check/ check/ | +30 | 0 replies | |
| 2/7 | btrfs-progs: check/original: Add inode mode checkcheck/ check/ | +6 | 0 replies | |
| 3/7 | btrfs-progs: check/lowmem: Repair invalid inode mode in root treecheck/ check/ check/ | +104 | 0 replies | |
| 4/7 | btrfs-progs: check/original: Repair invalid inode mode in root treecheck/ | +26 | 0 replies | |
| 5/7 | btrfs: check/lowmem: Check and repair free space cache inode modecheck/ check/ check/ +1 more | +51 | 0 replies | |
| 6/7 | btrfs: check/original: Check and repair free space cache inode itemcheck/ | +11 | 0 replies | |
| 7/7 | btrfs: tests/fsck: Add test image for free space cache mode repairtests/ | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/7] btrfs: check: Check and repair invalid free space cahce inode mode
This patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/free_space_cache_imode_fix
Which is based on v4.20.2 tag.
There is a minor problem reported in mail list where invalid inode mode
(0) can sneak into free space cache inodes:
item 9 key (256 INODE_ITEM 0) itemoff 13702 itemsize 160
generation 30 transid 30 size 65536 nbytes 1507328
block group 0 mode 0 links 1 uid 0 gid 0 rdev 0
sequence 23 flags 0x1b(NODATASUM|NODATACOW|NOCOMPRESS|PREALLOC)
atime 0.0 (1970-01-01 08:00:00)
ctime 1553491158.189771625 (2019-03-25 13:19:18)
mtime 0.0 (1970-01-01 08:00:00)
otime 0.0 (1970-01-01 08:00:00)Kernel free space cache code doesn't realy care about the inode mode, but tree-checker inode item checker cares and will report this as big problem, rejecting the image.
I didn't see any reason to make inode item checker any less strict, as there is already fuzzed image can break kernel using invalid inode mode.
So here I just enhance btrfs-progs before strict inode item checker lands.
Next time when users report kernel rejecting previously valid fs, they should have a way to fix it in btrfs-progs.
Changelog:
v2:
- Minor refactor to make common code more common.
Qu Wenruo (7):
btrfs-progs: check/lowmem: Add inode mode check
btrfs-progs: check/original: Add inode mode check
btrfs-progs: check/lowmem: Repair invalid inode mode in root tree
btrfs-progs: check/original: Repair invalid inode mode in root tree
btrfs: check/lowmem: Check and repair free space cache inode mode
btrfs: check/original: Check and repair free space cache inode item
btrfs: tests/fsck: Add test image for free space cache mode repair
check/main.c | 42 ++++++ check/mode-common.c | 129 ++++++++++++++++++ check/mode-common.h | 29 ++++ check/mode-lowmem.c | 22 +++ check/mode-lowmem.h | 3 + check/mode-original.h | 1 + .../test.raw.xz | Bin 0 -> 159128 bytes 7 files changed, 226 insertions(+) create mode 100644 tests/fsck-tests/038-bad-free-space-cache-inode-mode/test.raw.xz
Signature · 1 line
2.21.0