Commit 2db7312d authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH - knfsd fixes for 2.5.6

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
parent 6e18087f
...@@ -561,6 +561,10 @@ CONFIG_NFSD_V3 ...@@ -561,6 +561,10 @@ CONFIG_NFSD_V3
If you would like to include the NFSv3 server as well as the NFSv2 If you would like to include the NFSv3 server as well as the NFSv2
server, say Y here. If unsure, say Y. 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 CONFIG_HPFS_FS
OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS 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 is the file system used for organizing files on OS/2 hard disk
......
...@@ -447,11 +447,13 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, ...@@ -447,11 +447,13 @@ nlm4svc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
if (nlmsvc_ops != NULL) { if (nlmsvc_ops != NULL) {
struct svc_client *clnt; struct svc_client *clnt;
saddr.sin_addr.s_addr = argp->addr; saddr.sin_addr.s_addr = argp->addr;
nlmsvc_ops->exp_readlock();
if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL
&& (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) { && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
nlmsvc_free_host_resources(host); nlmsvc_free_host_resources(host);
} }
nlm_release_host(host); nlm_release_host(host);
nlmsvc_ops->exp_unlock();
} }
return rpc_success; return rpc_success;
......
...@@ -475,11 +475,13 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp, ...@@ -475,11 +475,13 @@ nlmsvc_proc_sm_notify(struct svc_rqst *rqstp, struct nlm_reboot *argp,
if (nlmsvc_ops != NULL) { if (nlmsvc_ops != NULL) {
struct svc_client *clnt; struct svc_client *clnt;
saddr.sin_addr.s_addr = argp->addr; saddr.sin_addr.s_addr = argp->addr;
nlmsvc_ops->exp_readlock();
if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL if ((clnt = nlmsvc_ops->exp_getclient(&saddr)) != NULL
&& (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) { && (host = nlm_lookup_host(clnt, &saddr, 0, 0)) != NULL) {
nlmsvc_free_host_resources(host); nlmsvc_free_host_resources(host);
} }
nlm_release_host(host); nlm_release_host(host);
nlmsvc_ops->exp_unlock();
} }
return rpc_success; return rpc_success;
......
...@@ -455,13 +455,19 @@ exp_getclient(struct sockaddr_in *sin) ...@@ -455,13 +455,19 @@ exp_getclient(struct sockaddr_in *sin)
for (hp = head; (tmp = *hp) != NULL; hp = &(tmp->h_next)) { for (hp = head; (tmp = *hp) != NULL; hp = &(tmp->h_next)) {
if (tmp->h_addr.s_addr == addr) { 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 */ /* Move client to the front */
if (head != hp) { if (head != hp) {
*hp = tmp->h_next; *hp = tmp->h_next;
tmp->h_next = *head; tmp->h_next = *head;
*head = tmp; *head = tmp;
} }
#endif
return tmp->h_client; return tmp->h_client;
} }
} }
......
...@@ -77,6 +77,7 @@ EXPORT_SYMBOL(svc_process); ...@@ -77,6 +77,7 @@ EXPORT_SYMBOL(svc_process);
EXPORT_SYMBOL(svc_recv); EXPORT_SYMBOL(svc_recv);
EXPORT_SYMBOL(svc_wake_up); EXPORT_SYMBOL(svc_wake_up);
EXPORT_SYMBOL(svc_makesock); EXPORT_SYMBOL(svc_makesock);
EXPORT_SYMBOL(svc_reserve);
/* RPC statistics */ /* RPC statistics */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment