Module Name:    src
Committed By:   pooka
Date:           Sun Mar  6 10:33:40 UTC 2011

Modified Files:
        src/tests/fs/vfs: t_full.c

Log Message:
Add a kludge to prevent a test run from completely hanging.
Some analysis:

1) p2k_ffs test program opens a socketpair and forks off rump_ffs
2) after mounting the file system, test program decides it
   wants to skip the test and exits
3) somehow, the puffs event thread of rump_ffs stays in kqueue
   waiting for activity.  fstat+gdb suggests it's waiting for the
   now-orphaned socketpair (but I didn't fully verify.  is there
   an easy way to dump the state of a kqueue descriptor?).
4) test program is a zombie
5) atf-run waits forever

Note: this doesn't trigger always.

So, it seems there are at least two bugs: 1) test case doesn't
timeout 2) the kevent call in rump_ffs never returns even though
the sockerpair is orphaned

So, explicitly unmount the file system before skipping the test.
Obviously the above bugs needs to be properly fixed, since other
skipping test cases can unbeknowingly trigger the issue.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/fs/vfs/t_full.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/vfs/t_full.c
diff -u src/tests/fs/vfs/t_full.c:1.5 src/tests/fs/vfs/t_full.c:1.6
--- src/tests/fs/vfs/t_full.c:1.5	Fri Jan  7 11:41:54 2011
+++ src/tests/fs/vfs/t_full.c	Sun Mar  6 10:33:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_full.c,v 1.5 2011/01/07 11:41:54 pooka Exp $	*/
+/*	$NetBSD: t_full.c,v 1.6 2011/03/06 10:33:40 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -57,6 +57,13 @@
 	int fd, i = 0;
 
 	if (FSTYPE_P2K_FFS(tc) || FSTYPE_PUFFS(tc) || FSTYPE_RUMPFS(tc)) {
+		/*
+		 * XXX: explicitly unmount to prevent some race.
+		 * temporary hack, fix properly
+		 */
+		if (FSTYPE_P2K_FFS(tc)) {
+			puffs_fstest_unmount(tc, mp, MNT_FORCE);
+		}
 		atf_tc_skip("fs does not support explicit block allocation "
 		    "(GOP_ALLOC)");
 	}

Reply via email to