xfstests: Make test 272 work for ext3
authorJan Kara <jack@suse.cz>
Thu, 16 Aug 2012 09:14:35 +0000 (11:14 +0200)
committerBen Myers <bpm@sgi.com>
Tue, 18 Sep 2012 21:20:34 +0000 (16:20 -0500)
ext3 does not support direct IO for files with data journalling. This
confuses test 272. Make the test check whether open succeeds and perform
the writing only if it does.

Thanks for Dave Chinner for suggesting a simpler way to fix the test.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
272
272.out

diff --git a/272 b/272
index 26dfa3b8c63a07e80bd8f39766ceab103e6802fd..c7f1efc1d16ca8a019e7752912f6b3659e8537cb 100755 (executable)
--- a/272
+++ b/272
@@ -32,15 +32,17 @@ tmp=/tmp/$$
 status=1       # failure is the default!
 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 
+# ext3 doesn't support direct IO in journalling mode
+write_opt_list="iflag=noatime conv=notrunc conv=fsync"
+# For filesystems that can handle it, add also direct IO test
+[ $FSTYP = "ext4" ] && write_opt_list="$write_opt_list oflag=direct"
+
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
 _workout()
 {
-       echo ""
-       echo " Switch data journalling mode"
-       echo ""
-       write_opt_list="iflag=noatime conv=notrunc conv=fsync oflag=direct"
+       echo "Switch data journalling mode. Silence is golden."
        chattr_opt_list="+j -j +jS -j"
        idx=0
        #
@@ -51,7 +53,7 @@ _workout()
                do
                    
                        echo "OP write_opt: $write_opt 4M, \
-chattr_opt: $chattr_opt"
+chattr_opt: $chattr_opt" >>$seq.full
                        dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
                                bs=1M count=4 $write_opt \
                                >> $seq.full 2>&1 || exit
@@ -69,7 +71,7 @@ chattr_opt: $chattr_opt"
                do
 
                        echo "OP write_opt: $write_opt ENOSPC, \
-chattr_opt: $chattr_opt"
+chattr_opt: $chattr_opt" >>$seq.full
                        dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
                                bs=1M $write_opt >> $seq.full 2>&1
                        chattr $chattr_opt $SCRATCH_MNT/file.$idx \
diff --git a/272.out b/272.out
index cc687aad913c51786e85a82a0c753e48b378b00b..a9eaf84c43e6c50fd8d4758835317a2c4cd999d8 100644 (file)
--- a/272.out
+++ b/272.out
@@ -1,37 +1,3 @@
 QA output created by 272
-
- Switch data journalling mode
-
-OP write_opt: iflag=noatime 4M, chattr_opt: +j
-OP write_opt: iflag=noatime 4M, chattr_opt: -j
-OP write_opt: iflag=noatime 4M, chattr_opt: +jS
-OP write_opt: iflag=noatime 4M, chattr_opt: -j
-OP write_opt: conv=notrunc 4M, chattr_opt: +j
-OP write_opt: conv=notrunc 4M, chattr_opt: -j
-OP write_opt: conv=notrunc 4M, chattr_opt: +jS
-OP write_opt: conv=notrunc 4M, chattr_opt: -j
-OP write_opt: conv=fsync 4M, chattr_opt: +j
-OP write_opt: conv=fsync 4M, chattr_opt: -j
-OP write_opt: conv=fsync 4M, chattr_opt: +jS
-OP write_opt: conv=fsync 4M, chattr_opt: -j
-OP write_opt: oflag=direct 4M, chattr_opt: +j
-OP write_opt: oflag=direct 4M, chattr_opt: -j
-OP write_opt: oflag=direct 4M, chattr_opt: +jS
-OP write_opt: oflag=direct 4M, chattr_opt: -j
-OP write_opt: iflag=noatime ENOSPC, chattr_opt: +j
-OP write_opt: iflag=noatime ENOSPC, chattr_opt: -j
-OP write_opt: iflag=noatime ENOSPC, chattr_opt: +jS
-OP write_opt: iflag=noatime ENOSPC, chattr_opt: -j
-OP write_opt: conv=notrunc ENOSPC, chattr_opt: +j
-OP write_opt: conv=notrunc ENOSPC, chattr_opt: -j
-OP write_opt: conv=notrunc ENOSPC, chattr_opt: +jS
-OP write_opt: conv=notrunc ENOSPC, chattr_opt: -j
-OP write_opt: conv=fsync ENOSPC, chattr_opt: +j
-OP write_opt: conv=fsync ENOSPC, chattr_opt: -j
-OP write_opt: conv=fsync ENOSPC, chattr_opt: +jS
-OP write_opt: conv=fsync ENOSPC, chattr_opt: -j
-OP write_opt: oflag=direct ENOSPC, chattr_opt: +j
-OP write_opt: oflag=direct ENOSPC, chattr_opt: -j
-OP write_opt: oflag=direct ENOSPC, chattr_opt: +jS
-OP write_opt: oflag=direct ENOSPC, chattr_opt: -j
+Switch data journalling mode. Silence is golden.
 Check filesystem