Module Name: src
Committed By: pooka
Date: Fri Nov 12 17:33:28 UTC 2010
Modified Files:
src/tests/fs/puffs: Makefile
Added Files:
src/tests/fs/puffs: t_io.c
Log Message:
Add test case for problem described by yamt in PR kern/44086.
"large writes with PUFFS_KFLAG_NOCACHE_PAGE ends up with EIO"
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/fs/puffs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/puffs/t_io.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/fs/puffs/Makefile
diff -u src/tests/fs/puffs/Makefile:1.11 src/tests/fs/puffs/Makefile:1.12
--- src/tests/fs/puffs/Makefile:1.11 Sat Jul 31 17:11:45 2010
+++ src/tests/fs/puffs/Makefile Fri Nov 12 17:33:28 2010
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2010/07/31 17:11:45 pooka Exp $
+# $NetBSD: Makefile,v 1.12 2010/11/12 17:33:28 pooka Exp $
#
.include <bsd.own.mk>
@@ -9,6 +9,7 @@
TESTS_C= t_basic
TESTS_C+= t_fuzz
+TESTS_C+= t_io
VFSTESTDIR != cd ${.CURDIR}/../common && ${PRINTOBJDIR}
LDADD+=-L${VFSTESTDIR} -lvfstest
@@ -20,7 +21,8 @@
LDADD+= -lrump -lrumpuser -lpthread
# required by -DPUFFSDUMP
-#LDADD+= -lpuffs -lutil
+LDADD+= -lpuffs -lutil
+CPPFLAGS+= -I/home/pooka/src/curpuffs/libpuffs
WARNS=2
Added files:
Index: src/tests/fs/puffs/t_io.c
diff -u /dev/null src/tests/fs/puffs/t_io.c:1.1
--- /dev/null Fri Nov 12 17:33:28 2010
+++ src/tests/fs/puffs/t_io.c Fri Nov 12 17:33:28 2010
@@ -0,0 +1,61 @@
+/* $NetBSD: t_io.c,v 1.1 2010/11/12 17:33:28 pooka Exp $ */
+
+#include <sys/types.h>
+#include <sys/mount.h>
+#include <sys/socket.h>
+
+#include <assert.h>
+#include <atf-c.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <puffs.h>
+#include <puffsdump.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <rump/rump.h>
+#include <rump/rump_syscalls.h>
+
+#include "../../h_macros.h"
+#include "../common/h_fsmacros.h"
+
+#define MAKEOPTS(...) \
+ char *theopts[] = {NULL, "-s", __VA_ARGS__, "dtfs", "n/a", NULL}
+
+ATF_TC(nocache);
+ATF_TC_HEAD(nocache, tc)
+{
+
+ atf_tc_set_md_var(tc, "descr", "tests large i/o without page cache");
+}
+
+ATF_TC_BODY(nocache, tc)
+{
+ MAKEOPTS("-o", "nopagecache");
+ char data[1024*1024];
+ void *args;
+ int fd;
+
+ FSTEST_CONSTRUCTOR_FSPRIV(tc, puffs, args, theopts);
+ FSTEST_ENTER();
+
+ RL(fd = rump_sys_open("afile", O_CREAT | O_RDWR, 0755));
+ RL(rump_sys_write(fd, data, sizeof(data)));
+ rump_sys_close(fd);
+
+ FSTEST_EXIT();
+ FSTEST_DESTRUCTOR(tc, puffs, args);
+}
+
+
+ATF_TP_ADD_TCS(tp)
+{
+
+ ATF_TP_ADD_TC(tp, nocache);
+
+ return atf_no_error();
+}