]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] kNFSd: Fix nfs shutdown problem.
authorNeil Brown <neilb@cse.unsw.edu.au>
Wed, 30 Oct 2002 08:24:12 +0000 (00:24 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Wed, 30 Oct 2002 08:24:12 +0000 (00:24 -0800)
The 'unexport everything' that happens when the
last nfsd thread dies was shuting down too much -
things that should only be shut down on module unload.

fs/nfsd/export.c
fs/nfsd/nfssvc.c
include/linux/nfsd/export.h
net/sunrpc/sunrpc_syms.c

index 43228c2a2acacc88e3e8bb66aa0fb4163f3de0a4..bad996892e619f41c7a45e32857305fe14fdb365 100644 (file)
@@ -738,23 +738,6 @@ exp_do_unexport(svc_export *unexp)
        exp_fsid_unhash(unexp);
 }
 
-/*
- * Revoke all exports for a given client.
- */
-static void
-exp_unexport_all(svc_client *clp)
-{
-       struct svc_export *exp;
-       int index;
-
-       dprintk("unexporting all fs's for clnt %p\n", clp);
-
-       cache_for_each(exp, &svc_export_cache, index, h)
-               if (exp->ex_client == clp)
-                       exp_do_unexport(exp);
-       cache_flush();
-
-}
 
 /*
  * unexport syscall.
@@ -1108,6 +1091,18 @@ nfsd_export_init(void)
 
 }
 
+/*
+ * Flush exports table - called when last nfsd thread is killed
+ */
+void
+nfsd_export_flush(void)
+{
+       exp_writelock();
+       cache_purge(&svc_expkey_cache);
+       cache_purge(&svc_export_cache);
+       exp_writeunlock();
+}
+
 /*
  * Shutdown the exports module.
  */
@@ -1119,8 +1114,6 @@ nfsd_export_shutdown(void)
 
        exp_writelock();
 
-       exp_unexport_all(NULL);
-
        if (cache_unregister(&svc_expkey_cache))
                printk(KERN_ERR "nfsd: failed to unregister expkey cache\n");
        if (cache_unregister(&svc_export_cache))
index 0f8be15737a3f4d921ec369ea320e8148c98b48d..a12f2c980865615f0fafc9c7ac490a011469d84a 100644 (file)
@@ -238,7 +238,7 @@ nfsd(struct svc_rqst *rqstp)
                printk(KERN_WARNING "nfsd: last server has exited\n");
                if (err != SIG_NOCLEAN) {
                        printk(KERN_WARNING "nfsd: unexporting all filesystems\n");
-                       nfsd_export_shutdown();
+                       nfsd_export_flush();
                }
                nfsd_serv = NULL;
                nfsd_racache_shutdown();        /* release read-ahead cache */
index 4d692bb2797f5c9a5892b5ffb65647a434ba085e..864e3b801f0f8a4e539f0b7ddcf197429f2496e1 100644 (file)
@@ -83,6 +83,7 @@ struct svc_expkey {
  */
 void                   nfsd_export_init(void);
 void                   nfsd_export_shutdown(void);
+void                   nfsd_export_flush(void);
 void                   exp_readlock(void);
 void                   exp_readunlock(void);
 struct svc_expkey *    exp_find_key(struct auth_domain *clp, 
index a738a191c675fad0aec73b94f43bda2170c6ae46..209219f998acde3bc7440d1c02a46b997d9f7925 100644 (file)
@@ -101,6 +101,7 @@ EXPORT_SYMBOL(auth_unix_lookup);
 EXPORT_SYMBOL(cache_check);
 EXPORT_SYMBOL(cache_clean);
 EXPORT_SYMBOL(cache_flush);
+EXPORT_SYMBOL(cache_purge);
 EXPORT_SYMBOL(cache_fresh);
 EXPORT_SYMBOL(cache_init);
 EXPORT_SYMBOL(cache_register);