]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: avoid libxfs buffer lookup warnings
authorDave Chinner <dchinner@redhat.com>
Wed, 13 Nov 2013 06:40:53 +0000 (06:40 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 13 Nov 2013 17:16:05 +0000 (11:16 -0600)
commitba9ecd40b3792961f12102af55c759d0432a6486
tree5659a4841dcf89a44209637f2bd343f1ac9a5122
parent06d80a7c09287581002c275fd21cfecdbdefcc15
xfs_db: avoid libxfs buffer lookup warnings

xfs_db is unique in the way it can read the same blocks with
different lengths from disk, so we really need a way to avoid having
duplicate buffers in the cache. To handle this in a generic way,
introduce a "purge on compare failure" feature to libxfs.

What this feature does is instead of throwing a warning when a
buffer miscompare occurs (e.g. due to a length mismatch), it purges
the buffer that is in cache from the cache. We can do this safely in
the context of xfs_db because it always writes back changes made to
buffers before it releases the reference to the buffer. Hence we can
purge buffers directly from the lookup code without having to worry
about whether they are dirty or not.

Doing this purge on miscompare operation avoids the
problem that libxfs is currently warning about, and hence if the
feature flag is set then we don't need to warn about miscompares any
more. Hence the whole problem goes away entirely for xfs_db, without
affecting any of the other users of libxfs based IO.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
db/init.c
include/cache.h
include/libxfs.h
libxfs/cache.c
libxfs/init.c
libxfs/rdwr.c
repair/xfs_repair.c