Skip to contentSkip to conversation

198: test aio+dio writes into sparse files

PATCH New Eric Sandeen 1 participant 1 message Dec 29, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 198: test aio+dio writes into sparse files

Older kernels were not doing completion properly, and converting unwritten extents at the wrong offsets; this exposed stale data.

Xen w/ the blktap driver was hitting this.

---

198 new file +45 -0
Index: xfstests/198
===================================================================
@@ -0,0 +1,45 @@
+#! /bin/sh
+# FS QA Test No. 198
+#
+# Test that aio+dio into holes does completion at the proper offsets
+# See also https://bugzilla.redhat.com/show_bug.cgi?id=217098
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2008 Eric Sandeen.  All Rights Reserved.
+#-----------------------------------------------------------------------
+#
+# creator
[email protected]
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1        # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# This should actually run on anything that supports O_DIRECT + AIO...
+_supported_fs xfs
+_supported_os Linux
+
+echo "Silence is golden."
+
+# real QA test starts here
+rm -f $seq.full
+
+rm -f "$TEST_DIR/aiodio_sparse*"
+$here/src/aiodio_sparse2 "$TEST_DIR/aiodio_sparse"
+
+status=$?
+exit
198.out new file +2 -0
Index: xfstests/198.out
===================================================================
@@ -0,0 +1,2 @@
+QA output created by 198
+Silence is golden.
group +1 -0
Index: xfstests/group
===================================================================
@@ -288,3 +288,4 @@ nfs4acl		[email protected] [email protected]
 189 mount auto
 190 rw auto
 191 nfs4acl auto
+198 aio auto
src/Makefile +8 -0
Index: xfstests/src/Makefile
===================================================================
@@ -17,6 +17,11 @@ LINUX_TARGETS = loggen xfsctl bstat t_mt
 	fs_perms testx looptest locktest unwritten_mmap \
 	bulkstat_unlink_test bulkstat_unlink_test_modified
 
+ifeq ($(HAVE_AIO), true)
+LINUX_TARGETS += aiodio_sparse2
+LIBAIO = -laio
+endif
+
 IRIX_TARGETS = open_unlink
 
 ifeq ($(PKG_PLATFORM),linux)
@@ -115,6 +120,9 @@ locktest: locktest.o
 unwritten_sync: unwritten_sync.o
 	$(LINKTEST)
 
+aiodio_sparse2: aiodio_sparse2.o
+	$(LINKTEST) $(LIBAIO)
+
 ifeq ($(PKG_PLATFORM),irix)
 fill2: fill2.o
 	$(LINKTEST)  -lgen
src/aiodio_sparse2.c new file +385 -0

385 lines not on this page · raw message

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs