]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: add crc manipulation commands
authorEric Sandeen <sandeen@sandeen.net>
Fri, 26 Aug 2016 01:20:39 +0000 (11:20 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 26 Aug 2016 01:20:39 +0000 (11:20 +1000)
commitb64af2c48220c85674a8334a229bf236fb949364
treef4c75d41fc5a2afc3817651d281b378cec7ea518
parentb20b6c22cd57f7f1671b7b8acd2c4610fcb9ade2
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>
db/Makefile
db/command.c
db/crc.c [new file with mode: 0644]
db/crc.h [new file with mode: 0644]
db/flist.c
db/flist.h
db/io.c
db/write.h
man/man8/xfs_db.8