]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] PATCH - knfsd fixes for 2.5.6
authorNeil Brown <neilb@cse.unsw.edu.au>
Mon, 11 Mar 2002 06:21:50 +0000 (22:21 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Mon, 11 Mar 2002 06:21:50 +0000 (22:21 -0800)
Fix a few kNFSd problems.

1/ export svc_reserve which was introduced for NFS/TCP support.
    Without this we cannot load nfsd.o as a module
2/ the hash chain of clients was being changed (to put the found
   entry at the top of the list) while we only had a read-lock.
   This could corrupt the list and cause big problems.
   For now, just disable this code.  Might add a lock later...
3/ lockd was calling exp_getclient without getting a readlock
   on the export table first.
4/ Add Config.help entry for CONFIG_NFSD_TCP

fs/Config.help
fs/lockd/svc4proc.c
fs/lockd/svcproc.c
fs/nfsd/export.c
net/sunrpc/sunrpc_syms.c

index 3581b6fa3896e327aef01a3d3170f6e23c2de567..8ccc8207858e9c53066882633dcb5cd750f01141 100644 (file)
@@ -561,6 +561,10 @@ CONFIG_NFSD_V3
   If you would like to include the NFSv3 server as well as the NFSv2
   server, say Y here.  If unsure, say Y.
 
+CONFIG_NFSD_TCP
+  Enable NFS service over TCP connections.  This the officially
+  still experimental, but seems to work well.
+
 CONFIG_HPFS_FS
   OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
   is the file system used for organizing files on OS/2 hard disk
index 3dbfb751cb03a5dd44e36862821e449dfb2066bc..1e2beb8f9c794d5e31a0e0d81ae7862e2f359e75 100644 (file)
@@ -447,11 +447,13 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
        if (nlmsvc_ops != NULL) {
                struct svc_client       *clnt;
                saddr.sin_addr.s_addr = argp->addr;
+               nlmsvc_ops->exp_readlock();
                if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL 
                 && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
                        nlmsvc_free_host_resources(host);
                }
                nlm_release_host(host);
+               nlmsvc_ops->exp_unlock();
        }
 
        return rpc_success;
index 313c676a76096b96b0cbb755cf0e44123ed07fce..15cf77853964d123a7755148f85a090bae9364ce 100644 (file)
@@ -475,11 +475,13 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
        if (nlmsvc_ops != NULL) {
                struct svc_client       *clnt;
                saddr.sin_addr.s_addr = argp->addr;     
+               nlmsvc_ops->exp_readlock();
                if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL 
                 && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
                        nlmsvc_free_host_resources(host);
                }
                nlm_release_host(host);
+               nlmsvc_ops->exp_unlock();
        }
 
        return rpc_success;
index 8fa94b183881e44471f68121218b6a12f1438069..3a18be362dc4410d2ba968d70bac5c67eaa81c80 100644 (file)
@@ -455,13 +455,19 @@ exp_getclient(struct sockaddr_in *sin)
 
        for (hp = head; (tmp = *hp) != NULL; hp = &(tmp->h_next)) {
                if (tmp->h_addr.s_addr == addr) {
+#if 0
+/* If we really want to do this, we need a spin
+lock to protect against multiple access (as we only
+have an exp_readlock) and need to protect
+the code in e_show() that walks this list too.
+*/
                        /* Move client to the front */
                        if (head != hp) {
                                *hp = tmp->h_next;
                                tmp->h_next = *head;
                                *head = tmp;
                        }
-
+#endif
                        return tmp->h_client;
                }
        }
index a2e89aad963959f4a2b99f4c044a4cae4c44c26b..67b07a3b1f7f4b930b6231b93a96bd24c8844455 100644 (file)
@@ -77,6 +77,7 @@ EXPORT_SYMBOL(svc_process);
 EXPORT_SYMBOL(svc_recv);
 EXPORT_SYMBOL(svc_wake_up);
 EXPORT_SYMBOL(svc_makesock);
+EXPORT_SYMBOL(svc_reserve);
 
 /* RPC statistics */
 #ifdef CONFIG_PROC_FS