Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs don't allow the nfs server module to unload if it ha...



details:   https://anonhg.NetBSD.org/src/rev/4e8c2d349003
branches:  trunk
changeset: 791974:4e8c2d349003
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Dec 14 16:19:28 2013 +0000

description:
don't allow the nfs server module to unload if it has exported filesystems.

diffstat:

 sys/nfs/nfs_export.c |  11 +++++++++--
 sys/nfs/nfs_serv.c   |   6 ++++--
 sys/nfs/nfs_var.h    |   3 ++-
 3 files changed, 15 insertions(+), 5 deletions(-)

diffs (71 lines):

diff -r 0fdf4403cf0e -r 4e8c2d349003 sys/nfs/nfs_export.c
--- a/sys/nfs/nfs_export.c      Sat Dec 14 16:03:04 2013 +0000
+++ b/sys/nfs/nfs_export.c      Sat Dec 14 16:19:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_export.c,v 1.57 2013/11/23 14:20:46 christos Exp $ */
+/*     $NetBSD: nfs_export.c,v 1.58 2013/12/14 16:19:28 christos Exp $ */
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2008 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.57 2013/11/23 14:20:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_export.c,v 1.58 2013/12/14 16:19:28 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -877,3 +877,10 @@
 
        rw_exit(&netexport_lock);
 }
+
+bool
+netexport_hasexports(void)
+{
+       
+       return nfs_pub.np_valid || !TAILQ_EMPTY(&netexport_list);
+}
diff -r 0fdf4403cf0e -r 4e8c2d349003 sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c        Sat Dec 14 16:03:04 2013 +0000
+++ b/sys/nfs/nfs_serv.c        Sat Dec 14 16:19:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_serv.c,v 1.166 2013/09/14 22:29:08 martin Exp $    */
+/*     $NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.166 2013/09/14 22:29:08 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.167 2013/12/14 16:19:28 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -125,6 +125,8 @@
                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;
diff -r 0fdf4403cf0e -r 4e8c2d349003 sys/nfs/nfs_var.h
--- a/sys/nfs/nfs_var.h Sat Dec 14 16:03:04 2013 +0000
+++ b/sys/nfs/nfs_var.h Sat Dec 14 16:19:28 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_var.h,v 1.90 2010/03/02 23:19:09 pooka Exp $       */
+/*     $NetBSD: nfs_var.h,v 1.91 2013/12/14 16:19:28 christos Exp $    */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -349,4 +349,5 @@
 void netexport_rdunlock(void);
 void netexport_init(void);
 void netexport_fini(void);
+bool netexport_hasexports(void);
 #endif /* _KERNEL */



Home | Main Index | Thread Index | Old Index