]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_db: use directio for device access
authorDarrick J. Wong <djwong@kernel.org>
Mon, 25 Sep 2023 21:59:16 +0000 (14:59 -0700)
committerCarlos Maiolino <cem@kernel.org>
Thu, 5 Oct 2023 12:57:20 +0000 (14:57 +0200)
XFS and tools (mkfs, copy, repair) don't generally rely on the block
device page cache, preferring instead to use directio.  For whatever
reason, the debugger was never made to do this, but let's do that now.

This should eliminate the weird fstests failures resulting from
udev/blkid pinning a cache page while the unmounting filesystem writes
to the superblock such that xfs_db finds the stale pagecache instead of
the post-unmount superblock.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
db/init.c

index eec65d0884dff7eee1bd12b6e47ed660e818c100..4599cc00d7119b34c7abc631e8773737d2eff0ea 100644 (file)
--- a/db/init.c
+++ b/db/init.c
@@ -96,6 +96,7 @@ init(
                x.volname = fsdevice;
        else
                x.dname = fsdevice;
+       x.isdirect = LIBXFS_DIRECT;
 
        x.bcache_flags = CACHE_MISCOMPARE_PURGE;
        if (!libxfs_init(&x)) {