Module Name:    src
Committed By:   christos
Date:           Sat Dec 14 22:04:03 UTC 2013

Modified Files:
        src/sys/nfs: nfs_serv.c

Log Message:
only prevent autounload, not regular unload when we have exports


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/nfs/nfs_serv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.167 src/sys/nfs/nfs_serv.c:1.168
--- src/sys/nfs/nfs_serv.c:1.167	Sat Dec 14 11:19:28 2013
+++ src/sys/nfs/nfs_serv.c	Sat Dec 14 17:04:03 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.168 2013/12/14 22:04:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.168 2013/12/14 22:04:03 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -125,8 +125,6 @@ nfsserver_modcmd(modcmd_t cmd, void *arg
 		nfs_timer_srvinit(nfsrv_timer);
 		return 0;
 	case MODULE_CMD_FINI:
-		if (netexport_hasexports())
-			return EBUSY;
 		error = syscall_disestablish(NULL, nfsserver_syscalls);
 		if (error != 0) {
 			return error;
@@ -146,6 +144,10 @@ nfsserver_modcmd(modcmd_t cmd, void *arg
 		nfsrv_finicache();
 		nfs_fini();
 		return 0;
+	case MODULE_CMD_AUTOUNLOAD:
+		if (netexport_hasexports())
+			return EBUSY;
+		/*FALLTHROUGH*/
 	default:
 		return ENOTTY;
 	}

Reply via email to