btrfs-progs/check
Qu Wenruo d2a450793f btrfs-progs: check: detect deprecated inode cache
[BUG]
There are reports about deprecated inode cache causing newer kernels to
rejecting them.

Such inode cache is rarely utilized and already fully deprecated since
v5.11, and newer kernel will reject data extents of inode cache since
v6.11.

But original mode btrfs check won't detect nor report them as error.
Meanwhile lowmem mode can properly detect and report them:

 ERROR: root 5 INODE[18446744073709551604] nlink(1) not equal to inode_refs(0)
 ERROR: invalid imode mode bits: 00
 ERROR: invalid inode generation 18446744073709551604 or transid 1 for ino 18446744073709551605, expect [0, 72)
 ERROR: root 5 INODE[18446744073709551605] is orphan item

Since those inode cache paid no attention to properly maintain all the
numbers, they are easy targets for more recent lowmem mode.

[CAUSE]
For original mode, it has extra hardcoded hacks to avoid nlink checks
for inode cache inode.
Furthermore original mode doesn't check the mode bits nor its
generation.

[FIX]
For original mode, remove the hack for inode cache so that the
deprecated inode cache can be reported as an error.

For both modes, add extra global message to direct the affected users to
use 'btrfs rescue clear-ino-cache' to clear the deprecated cache.

Pull-request: #891
Signed-off-by: Qu Wenruo <wqu@suse.com>
2024-09-17 14:33:22 +02:00
..
common.h btrfs-progs: add extra chunk alignment checks 2024-01-16 19:14:37 +01:00
main.c btrfs-progs: check: detect deprecated inode cache 2024-09-17 14:33:22 +02:00
mode-common.c btrfs-progs: fix warnings reported by -Wold-style-definition 2024-07-30 19:53:32 +02:00
mode-common.h btrfs-progs: check: use bool for option status variables 2024-04-30 19:34:52 +02:00
mode-lowmem.c btrfs-progs: check: detect deprecated inode cache 2024-09-17 14:33:22 +02:00
mode-lowmem.h btrfs-progs: do not check ram_bytes for non-compressed data extents 2024-06-25 17:42:17 +02:00
mode-original.h btrfs-progs: check: detect deprecated inode cache 2024-09-17 14:33:22 +02:00
qgroup-verify.c btrfs-progs: reorder key initializations 2024-04-30 21:49:15 +02:00
qgroup-verify.h
repair.c btrfs-progs: reorder key initializations 2024-04-30 21:49:15 +02:00
repair.h