xfsqa: Fix various test-suite related failures
cover xfsqa: Fix various test-suite related failures
These are all code changes to the test suite to fix problems with the execution of tests on a bleeding edge system.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 1/3 xfsqa: update 214 golden output
It does not contain the output from the recently added test, so fails when the test actually succeeds.
--- 214.out | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
214.out +4 -0
@@ -39,3 +39,7 @@ XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) * read 90112/90112 bytes at offset 0 XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +=== delalloc write 16k; fallocate same range === +wrote 16384/16384 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +
Signature · 6 lines
1.6.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 1/3] xfsqa: update 214 golden output
Quoted 4 lines · Dave Chinner
It does not contain the output from the recently added test, so fails when the test actually succeeds.
Signed-off-by Dave Chinner <[email protected]>
Looks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/3 xfsqa: Fix signal usage in aio-dio test code
In reply to Dave ChinnerUsing signal() to set up signal handlers doesn't always do what you want. A recent upgrade made test 208 fail because wait() was not getting interrupted by a SIGALRM. Tracing showed that signal() was being converted to a sigaction(SA_RESTART) handler, which allows syscalls that return ERESTARTSYS to immediately restart without returning EINTR to the calling process. The kernel code returns ERESTARTSYS to signal interruptions while in wait().
Replace the use of signal with sigaction() to ensure that the SA_RESTART flag is not set and the EINTR is delivered to the process sitting in wait(). This makes test 208 terminate at 200s again.
--- src/aio-dio-regress/aio-dio-invalidate-failure.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-)
src/aio-dio-regress/aio-dio-invalidate-failure.c +8 -1
@@ -21,6 +21,7 @@#include <unistd.h> #include <stdio.h> #include <stdlib.h> +#include <signal.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h>
@@ -117,6 +118,7 @@ int main(int argc, char **argv)int fd;int fd2;int status; +struct sigaction sa;if (argc !=2 )fail ("only arg should be file name" );
@@ -150,7 +152,12 @@ int main(int argc, char **argv)exit (0 ); } -signal (SIGALRM , alarm_handler); +memset (&sa,0 ,sizeof (sa)); + sa.sa_handler = alarm_handler; +sigemptyset (&sa.sa_mask); +if (sigaction (SIGALRM , &sa,NULL ) ==-1 ) +fail ("sigaction: %d\n" , errno); +alarm (SECONDS ); pid =wait (&status);
Signature · 6 lines
1.6.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 2/3] xfsqa: Fix signal usage in aio-dio test code
Quoted 11 lines · Dave Chinner
Using
signal()to set up signal handlers doesn't always do what you want. A recent upgrade made test 208 fail becausewait()was not getting interrupted by a SIGALRM. Tracing showed thatsignal()was being converted to asigaction(SA_RESTART)handler, which allows syscalls that return ERESTARTSYS to immediately restart without returning EINTR to the calling process. The kernel code returns ERESTARTSYS to signal interruptions while inwait().Replace the use of signal with
sigaction()to ensure that theSA_RESTARTflag is not set and the EINTR is delivered to the process sitting inwait(). This makes test 208 terminate at 200s again.
Yeah, signal is deprecated in favour of sigaction for a reason..
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/3 xfsqa: xfs_check can see stale cached blocks
In reply to Dave ChinnerTest 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.
--- common.rc | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
common.rc +2 -0
@@ -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 ]
Signature · 6 lines
1.6.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH 3/3] xfsqa: xfs_check can see stale cached blocks
Quoted 10 lines · Dave Chinner
Test 017 is consistently failing now because the
xfs_checkuses buffered IO to read the block device and 017 runsxfs_checkona remount,ro filesystem. Hence the block device cache is never invalidated (the unmount path does this) and soxfs_checkcan 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_checkto ensure that the blockdev cache is clean and we don't get false errors from stale blocks.
I don't think this is correct. We need to provide this synchronization from kernel land. IIRC Al even has a patch towards this in his tree, can't point you to it to try it because his tree on kernel.org seems messed up right now.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs