]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: fix inode CRC validity state, and warn on read if invalid
authorEric Sandeen <sandeen@sandeen.net>
Mon, 6 Apr 2015 23:19:28 +0000 (09:19 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 6 Apr 2015 23:19:28 +0000 (09:19 +1000)
commitb335ecb53b5bd31af939798d5e93daadeae44014
treee83d948277c4650252b43a9b7be9458f85317b34
parentc9f5e3db2209878abdf52d89e5532fe378dfaf15
xfs_db: fix inode CRC validity state, and warn on read if invalid

Currently, the "ino_crc_ok" field on the io cursor reflects
overall inode validity, not CRC correctness.  Because it is
only used when printing CRC validity, change it to reflect
only that state - and update it whenever we re-write the
inode (thus updating the CRC).

In addition, when reading an inode, warn if the CRC is bad.

Note, when specifying an inode which doesn't actually exist,
this will claim corruption; I'm not sure if that's good or
bad. Today, it already issues corruption errors on the way;
this adds a new message as well:

xfs_db> inode 129
Metadata corruption detected at block 0x80/0x2000
Metadata corruption detected at block 0x80/0x2000
...
Metadata CRC error detected for ino 129

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/inode.c
db/io.c
include/libxfs.h