]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_db: properly set dquot_buf when operating on dquot
authorEric Sandeen <sandeen@sandeen.net>
Thu, 8 Sep 2016 00:22:18 +0000 (10:22 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 8 Sep 2016 00:22:18 +0000 (10:22 +1000)
commit13061b87772599c00152006a2ffb65a4536a9560
treed2fb57bac6bf4558751a5335ba095db085e9da2c
parent88dabc17f4b4e2c3b9c41dd7fa30a8a06ac2d770
xfs_db: properly set dquot_buf when operating on dquot

The earlier commit:

66a40d02 db: verify and calculate dquot CRCs

added a "dquot_buf" to the iocur to specify when we were operating
on a dquot and thus handle dquot CRC updates - but nothing ever
actually set dquot_buf to a non-zero value.

Without doing so, we don't recalculate the dquot crc when
changing contents of a dquot:

# xfs_db -x -c "dquot -u 500" -c "p crc" -c "write diskdq.bcount 2" \
    -c "p crc" crctestfile
crc = 0xfd293c68 (correct)
diskdq.bcount = 2
crc = 0xfd293c68 (correct)

[ the "(correct)" tag is another, different issue ]

# xfs_db -x -c "dquot -u 500" -c "p crc" crctestfile
Metadata CRC error detected at xfs_dquot block 0xd8/0x1000
crc = 0xfd293c68 (bad)

With this change, dquot CRCs are properly recalculated in write_cur.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/dquot.c