Skip to contentSkip to conversation

xfstests: add aio-dio-regress tests

PATCH Superseded Eric Sandeen 2 participants 4 messages Apr 23, 2009 Kbuild

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: add aio-dio-regress tests

Think it's worth pulling this in?
Also not sure where to put it, under the top dir or under src ...

Takes about 250s to run them all. Could break out the longer one into a separate test so the rest could be in quick.

-Eric

206 new file +50 -0
new file mode 100755
index 0000000..026059f
@@ -0,0 +1,50 @@
+#! /bin/sh
+# FS QA Test No. 206
+#
+# Run the aio-dio-regress testsuite
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 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
+
+# real QA test starts here
+
+_supported_fs xfs udf nfs
+_supported_os Linux
+
+AIO_TESTS="aio-dio-extend-stat aio-dio-invalidate-failure \
+		aio-dio-invalidate-readahead aio-dio-subblock-eof-read \
+		aio-free-ring-with-bogus-nr-pages	\
+		aio-io-setup-with-nonwritable-context-pointer"
+
+for AIO_TEST in $AIO_TESTS; do
+	rm -f $TEST_DIR/aio-testfile
+	echo "==${AIO_TEST}=="
+	aio-dio-regress/$AIO_TEST $TEST_DIR/aio-testfile 2>&1
+done
+rm -f $TEST_DIR/aio-testfile
+
+# success, all done
+status=0
+exit
206.out new file +13 -0
new file mode 100644
index 0000000..e5da95b
@@ -0,0 +1,13 @@
+QA output created by 206
+==aio-dio-extend-stat==
+4000 iterations of racing extensions and collection passed
+==aio-dio-invalidate-failure==
+ran for 200 seconds without error, passing
+==aio-dio-invalidate-readahead==
+test ran for 30 seconds without error
+==aio-dio-subblock-eof-read==
+AIO read of last block in file succeeded.
+==aio-free-ring-with-bogus-nr-pages==
+aio-free-ring-with-bogus-nr-pages: Success!
+==aio-io-setup-with-nonwritable-context-pointer==
+aio-io-setup-with-nonwritable-context-pointer: Success!
Makefile +4 -0
index b017580..41cae71 100644
@@ -19,6 +19,10 @@ LDIRT = config.log .dep config.status config.cache confdefs.h conftest* \
 LIB_SUBDIRS = include lib
 TOOL_SUBDIRS = ltp src m4
 
+ifeq ($(HAVE_AIO), true)
+TOOL_SUBDIRS += aio-dio-regress
+endif
+
 SUBDIRS = $(LIB_SUBDIRS) $(TOOL_SUBDIRS)
 
 default: include/builddefs include/config.h $(DMAPI_MAKEFILE) new remake check $(TESTS)
aio-dio-regress/Makefile new file +20 -0
new file mode 100644
index 0000000..eb9109d
@@ -0,0 +1,20 @@
+TOPDIR = ..
+include $(TOPDIR)/include/builddefs
+
+TARGETS = $(basename $(wildcard *.c))
+
+CFILES = $(TARGETS:=.c)
+LDIRT = $(TARGETS)
+
+LIBAIO = -laio -lpthread
+
+default: $(TARGETS)
+
+include $(BUILDRULES)
+
+$(TARGETS): %: %.c
+	gcc -ggdb -Wall -laio -lpthread -o $@ $*.c
+
+install:
+	$(INSTALL) -m 755 -d $(PKG_LIB_DIR)/aio-dio-regress
+	$(INSTALL) -m 755 $(TARGETS) $(PKG_LIB_DIR)/aio-dio-regress
aio-dio-regress/aio-dio-extend-stat.c new file +163 -0

163 lines not on this page · raw message

aio-dio-regress/aio-dio-invalidate-failure.c new file +155 -0

155 lines not on this page · raw message

aio-dio-regress/aio-dio-invalidate-readahead.c new file +172 -0

172 lines not on this page · raw message

aio-dio-regress/aio-dio-subblock-eof-read.c new file +95 -0

95 lines not on this page · raw message

aio-dio-regress/aio-free-ring-with-bogus-nr-pages.c new file +65 -0

65 lines not on this page · raw message

aio-dio-regress/aio-io-setup-with-nonwritable-context-pointer.c new file +31 -0
new file mode 100644
index 0000000..c0ba09f
@@ -0,0 +1,31 @@
+/*
+ *  Author:  Jeff Moyer
+ *
+ *  Description: Pass a non-writable context pointer to io_setup to see if
+ *  the kernel deals with it correctly.  In the past, the reference counting
+ *  in this particular error path was off and this operation would cause an
+ *  oops.
+ *
+ *  This is a destructive test.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <libgen.h>
+#include <libaio.h>
+
+int
+main(int __attribute__((unused)) argc, char **argv)
+{
+	void *addr;
+
+	addr = mmap(NULL, 4096, PROT_READ, MAP_SHARED|MAP_ANONYMOUS, 0, 0);
+	if (!addr) {
+		perror("mmap");
+		exit(1);
+	}
+	io_setup(1, addr /* un-writable pointer */);
+
+	printf("%s: Success!\n", basename(argv[0]));
+	return 0;
+}
group +1 -0
index 0ac33c2..ca74d54 100644
@@ -310,3 +310,4 @@ atime
 203 ioctl auto
 204 metadata rw auto
 205 metadata rw auto
+206 auto aio

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

#1 lore raw
Quoted 5 lines · Eric Sandeen

Think it's worth pulling this in?
Also not sure where to put it, under the top dir or under src ...

Takes about 250s to run them all. Could break out the longer one into a separate test so the rest could be in quick.

I would prefer to have a separate test for each of the programs.

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

#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 5 lines · Eric Sandeen

Think it's worth pulling this in?
Also not sure where to put it, under the top dir or under src ...

Takes about 250s to run them all. Could break out the longer one into a separate test so the rest could be in quick.

I would prefer to have a separate test for each of the programs.

Fine by me. Any thoughts on if this should live under src/ or not? I'm not sure why ltp/ doesn't, but I was just following that.

Thanks,
-Eric

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

#3 lore raw
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Christoph Hellwig
Quoted 3 lines · Eric Sandeen

Think it's worth pulling this in?
Also not sure where to put it, under the top dir or under src ...

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Takes about 250s to run them all. Could break out the longer one into a separate test so the rest could be in quick.

I would prefer to have a separate test for each of the programs.

Fine by me. Any thoughts on if this should live under src/ or not? I'm not sure why ltp/ doesn't, but I was just following that.

I don't think it matters too much. The external dmapi tests are also under src. In doubt I would put it under src/

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