Mon Mar 14 19:05:20 2011 UTC ()
Apparently this way of triggering the msdosfs rename vnode leak
does not bite every time (most commonly observed on the amd64/qemu
runs), so add a race condition catcher.


(pooka)
diff -r1.21 -r1.22 src/tests/fs/vfs/t_renamerace.c

cvs diff -r1.21 -r1.22 src/tests/fs/vfs/t_renamerace.c (expand / switch to unified diff)

--- src/tests/fs/vfs/t_renamerace.c 2011/03/06 16:00:16 1.21
+++ src/tests/fs/vfs/t_renamerace.c 2011/03/14 19:05:19 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: t_renamerace.c,v 1.21 2011/03/06 16:00:16 pooka Exp $ */ 1/* $NetBSD: t_renamerace.c,v 1.22 2011/03/14 19:05:19 pooka Exp $ */
2 2
3/* 3/*
4 * Modified for rump and atf from a program supplied 4 * Modified for rump and atf from a program supplied
5 * by Nicolas Joly in kern/40948 5 * by Nicolas Joly in kern/40948
6 */ 6 */
7 7
8#include <sys/types.h> 8#include <sys/types.h>
9#include <sys/mount.h> 9#include <sys/mount.h>
10#include <sys/utsname.h> 10#include <sys/utsname.h>
11 11
12#include <atf-c.h> 12#include <atf-c.h>
13#include <errno.h> 13#include <errno.h>
14#include <fcntl.h> 14#include <fcntl.h>
@@ -103,28 +103,38 @@ renamerace(const atf_tc_t *tc, const cha @@ -103,28 +103,38 @@ renamerace(const atf_tc_t *tc, const cha
103 for (i = 0; i < NWRK; i++) 103 for (i = 0; i < NWRK; i++)
104 pthread_join(pt1[i], NULL); 104 pthread_join(pt1[i], NULL);
105 for (i = 0; i < NWRK; i++) 105 for (i = 0; i < NWRK; i++)
106 pthread_join(pt2[i], NULL); 106 pthread_join(pt2[i], NULL);
107 RL(rump_sys_chdir("/")); 107 RL(rump_sys_chdir("/"));
108 108
109 /* 109 /*
110 * XXX: does not always fail on LFS, especially for unicpu 110 * XXX: does not always fail on LFS, especially for unicpu
111 * configurations. see other ramblings about racy tests. 111 * configurations. see other ramblings about racy tests.
112 */ 112 */
113 if (FSTYPE_LFS(tc)) 113 if (FSTYPE_LFS(tc))
114 abort(); 114 abort();
115 115
116 if (FSTYPE_MSDOS(tc)) 116 if (FSTYPE_MSDOS(tc)) {
117 atf_tc_expect_fail("PR kern/44661"); 117 atf_tc_expect_fail("PR kern/44661");
 118 /*
 119 * XXX: race does not trigger every time at least
 120 * on amd64/qemu.
 121 */
 122 if (msdosfs_fstest_unmount(tc, mp, 0) != 0) {
 123 rump_pub_vfs_mount_print(mp, 1);
 124 atf_tc_fail_errno("unmount failed");
 125 }
 126 atf_tc_fail("race did not trigger this time");
 127 }
118} 128}
119 129
120static void 130static void
121renamerace_dirs(const atf_tc_t *tc, const char *mp) 131renamerace_dirs(const atf_tc_t *tc, const char *mp)
122{ 132{
123 pthread_t pt1, pt2; 133 pthread_t pt1, pt2;
124 134
125 if (FSTYPE_SYSVBFS(tc)) 135 if (FSTYPE_SYSVBFS(tc))
126 atf_tc_skip("directories not supported"); 136 atf_tc_skip("directories not supported");
127 137
128 if (FSTYPE_RUMPFS(tc)) 138 if (FSTYPE_RUMPFS(tc))
129 atf_tc_skip("rename not supported by fs"); 139 atf_tc_skip("rename not supported by fs");
130 140