]>
git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: add crc manipulation commands
This adds a new "crc" command to xfs_db for CRC-enabled filesystems.
If a structure has a CRC field, we can validate it, invalidate/corrupt
it, or revalidate/rewrite it:
xfs_db> sb 0
xfs_db> crc -v
crc = 0x796c814f (correct)
xfs_db> crc -i
Metadata CRC error detected at block 0x0/0x200
crc = 0x796c8150 (bad)
xfs_db> crc -r
crc = 0x796c814f (correct)
(-i and -r require "expert" write-capable mode)
This requires temporarily replacing the write verifier with
a dummy which won't recalculate the CRC on the way to disk.
It also required me to write a new flist function, which is
totally foreign to me, so hopefully done right - but it seems
to work here.
[ dchinner: rewrite write_cur() to also skip CRC updates on dquots,
fix set-but-unused warnings, use iotop_cur safely. ]
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>