[PATCH 3/3] xfsqa: xfs_check can see stale cached blocks

Dave Chinner david at fromorbit.com
Tue Jan 19 03:03:12 CST 2010


Test 017 is consistently failing now because the xfs_check uses
buffered IO to read the block device and 017 runs xfs_check ona
remount,ro filesystem. Hence the block device cache is never
invalidated (the unmount path does this) and so xfs_check can see
stale blocks from previous invocations instead of what is really on
disk at the time it is run.

Manually trash the page cache before running xfs_check to ensure
that the blockdev cache is clean and we don't get false errors
from stale blocks.

Signed-off-by: Dave Chinner <david at fromorbit.com>
---
 common.rc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common.rc b/common.rc
index 6424871..896e38d 100644
--- a/common.rc
+++ b/common.rc
@@ -318,6 +318,7 @@ _scratch_xfs_check()
     SCRATCH_OPTIONS=""
     [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
         SCRATCH_OPTIONS="-l $SCRATCH_LOGDEV"
+    [ "$HOSTOS" = "Linux" ] && echo 1 > /proc/sys/vm/drop_caches
     $XFS_CHECK_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV
 }
 
@@ -931,6 +932,7 @@ _check_xfs_filesystem()
         ok=0
     fi
 
+    [ "$HOSTOS" = "Linux" ] && echo 1 > /proc/sys/vm/drop_caches
     $XFS_CHECK_PROG $testoption $extra_log_options $device 2>&1 |\
 	 _fix_malloc >$tmp.fs_check
     if [ -s $tmp.fs_check ]
-- 
1.6.5




More information about the xfs mailing list