Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/fs Put the workaround for PR kern/43799 into the commo...
details: https://anonhg.NetBSD.org/src/rev/09b5f02a1028
branches: trunk
changeset: 757362:09b5f02a1028
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Aug 26 15:07:16 2010 +0000
description:
Put the workaround for PR kern/43799 into the common nfs unmount routine.
diffstat:
tests/fs/common/fstest_nfs.c | 23 +++++++++++++++++++----
tests/fs/vfs/t_renamerace.c | 10 +---------
2 files changed, 20 insertions(+), 13 deletions(-)
diffs (63 lines):
diff -r f9eadc81661b -r 09b5f02a1028 tests/fs/common/fstest_nfs.c
--- a/tests/fs/common/fstest_nfs.c Thu Aug 26 15:01:07 2010 +0000
+++ b/tests/fs/common/fstest_nfs.c Thu Aug 26 15:07:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fstest_nfs.c,v 1.3 2010/07/30 16:15:05 pooka Exp $ */
+/* $NetBSD: fstest_nfs.c,v 1.4 2010/08/26 15:07:16 pooka Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -196,11 +196,26 @@
nfs_fstest_unmount(const atf_tc_t *tc, const char *path, int flags)
{
struct nfstestargs *args = theargs;
- int status;
+ int status, i, sverrno;
- if (rump_sys_unmount(path, flags) == -1) {
- return errno;
+ /*
+ * NFS handles sillyrenames in an workqueue. Some of them might
+ * be still in the queue even if all user activity has ceased.
+ * We try to unmount for 2 seconds to give them a chance
+ * to flush out.
+ *
+ * PR kern/43799
+ */
+ for (i = 0; i < 20; i++) {
+ if ((status = rump_sys_unmount(path, flags)) == 0)
+ break;
+ sverrno = errno;
+ if (sverrno != EBUSY)
+ break;
+ usleep(100000);
}
+ if (status == -1)
+ return sverrno;
/*
* It's highly expected that the child will die next, so we
diff -r f9eadc81661b -r 09b5f02a1028 tests/fs/vfs/t_renamerace.c
--- a/tests/fs/vfs/t_renamerace.c Thu Aug 26 15:01:07 2010 +0000
+++ b/tests/fs/vfs/t_renamerace.c Thu Aug 26 15:07:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_renamerace.c,v 1.9 2010/08/25 18:11:20 pooka Exp $ */
+/* $NetBSD: t_renamerace.c,v 1.10 2010/08/26 15:07:16 pooka Exp $ */
/*
* Modified for rump and atf from a program supplied
@@ -115,14 +115,6 @@
*/
if (FSTYPE_LFS(tc))
abort();
-
- /*
- * NFS sillyrename is broken and may linger on in the file system.
- * This sleep lets them finish so we don't get transient unmount
- * failures.
- */
- if (FSTYPE_NFS(tc))
- sleep(1);
}
static void
Home |
Main Index |
Thread Index |
Old Index