aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 20:21:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 20:21:24 -0500
commit713404d6082fee34a829a0c6d511e4aec72d7654 (patch)
treedccfa03988c763b0b39241181f37cdffb5b0fdcc /net
parentd599edcaea987e233fad808f88850f725e8a5530 (diff)
parentdb43910cb42285a99f45f7e0a0a32e32d0b61dcf (diff)
Merge branch 'for-2.6.29' of git://linux-nfs.org/~bfields/linux
* 'for-2.6.29' of git://linux-nfs.org/~bfields/linux: (67 commits) nfsd: get rid of NFSD_VERSION nfsd: last_byte_offset nfsd: delete wrong file comment from nfsd/nfs4xdr.c nfsd: git rid of nfs4_cb_null_ops declaration nfsd: dprint each op status in nfsd4_proc_compound nfsd: add etoosmall to nfserrno NFSD: FIDs need to take precedence over UUIDs SUNRPC: The sunrpc server code should not be used by out-of-tree modules svc: Clean up deferred requests on transport destruction nfsd: fix double-locks of directory mutex svc: Move kfree of deferral record to common code CRED: Fix NFSD regression NLM: Clean up flow of control in make_socks() function NLM: Refactor make_socks() function nfsd: Ensure nfsv4 calls the underlying filesystem on LOCKT SUNRPC: Ensure the server closes sockets in a timely fashion NFSD: Add documenting comments for nfsctl interface NFSD: Replace open-coded integer with macro NFSD: Fix a handful of coding style issues in write_filehandle() NFSD: clean up failover sysctl function naming ...
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/cache.c20
-rw-r--r--net/sunrpc/stats.c6
-rw-r--r--net/sunrpc/svc.c14
-rw-r--r--net/sunrpc/svc_xprt.c58
-rw-r--r--net/sunrpc/svcauth.c14
-rw-r--r--net/sunrpc/svcauth_unix.c12
-rw-r--r--net/sunrpc/svcsock.c30
7 files changed, 96 insertions, 58 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index c9966713282a..4735caad26ed 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -98,7 +98,7 @@ struct cache_head *sunrpc_cache_lookup(struct cache_detail *detail,
98 98
99 return new; 99 return new;
100} 100}
101EXPORT_SYMBOL(sunrpc_cache_lookup); 101EXPORT_SYMBOL_GPL(sunrpc_cache_lookup);
102 102
103 103
104static void queue_loose(struct cache_detail *detail, struct cache_head *ch); 104static void queue_loose(struct cache_detail *detail, struct cache_head *ch);
@@ -173,7 +173,7 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail,
173 cache_put(old, detail); 173 cache_put(old, detail);
174 return tmp; 174 return tmp;
175} 175}
176EXPORT_SYMBOL(sunrpc_cache_update); 176EXPORT_SYMBOL_GPL(sunrpc_cache_update);
177 177
178static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h); 178static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h);
179/* 179/*
@@ -245,7 +245,7 @@ int cache_check(struct cache_detail *detail,
245 cache_put(h, detail); 245 cache_put(h, detail);
246 return rv; 246 return rv;
247} 247}
248EXPORT_SYMBOL(cache_check); 248EXPORT_SYMBOL_GPL(cache_check);
249 249
250/* 250/*
251 * caches need to be periodically cleaned. 251 * caches need to be periodically cleaned.
@@ -373,7 +373,7 @@ int cache_register(struct cache_detail *cd)
373 schedule_delayed_work(&cache_cleaner, 0); 373 schedule_delayed_work(&cache_cleaner, 0);
374 return 0; 374 return 0;
375} 375}
376EXPORT_SYMBOL(cache_register); 376EXPORT_SYMBOL_GPL(cache_register);
377 377
378void cache_unregister(struct cache_detail *cd) 378void cache_unregister(struct cache_detail *cd)
379{ 379{
@@ -399,7 +399,7 @@ void cache_unregister(struct cache_detail *cd)
399out: 399out:
400 printk(KERN_ERR "nfsd: failed to unregister %s cache\n", cd->name); 400 printk(KERN_ERR "nfsd: failed to unregister %s cache\n", cd->name);
401} 401}
402EXPORT_SYMBOL(cache_unregister); 402EXPORT_SYMBOL_GPL(cache_unregister);
403 403
404/* clean cache tries to find something to clean 404/* clean cache tries to find something to clean
405 * and cleans it. 405 * and cleans it.
@@ -514,7 +514,7 @@ void cache_flush(void)
514 while (cache_clean() != -1) 514 while (cache_clean() != -1)
515 cond_resched(); 515 cond_resched();
516} 516}
517EXPORT_SYMBOL(cache_flush); 517EXPORT_SYMBOL_GPL(cache_flush);
518 518
519void cache_purge(struct cache_detail *detail) 519void cache_purge(struct cache_detail *detail)
520{ 520{
@@ -523,7 +523,7 @@ void cache_purge(struct cache_detail *detail)
523 cache_flush(); 523 cache_flush();
524 detail->flush_time = 1; 524 detail->flush_time = 1;
525} 525}
526EXPORT_SYMBOL(cache_purge); 526EXPORT_SYMBOL_GPL(cache_purge);
527 527
528 528
529/* 529/*
@@ -988,7 +988,7 @@ void qword_add(char **bpp, int *lp, char *str)
988 *bpp = bp; 988 *bpp = bp;
989 *lp = len; 989 *lp = len;
990} 990}
991EXPORT_SYMBOL(qword_add); 991EXPORT_SYMBOL_GPL(qword_add);
992 992
993void qword_addhex(char **bpp, int *lp, char *buf, int blen) 993void qword_addhex(char **bpp, int *lp, char *buf, int blen)
994{ 994{
@@ -1017,7 +1017,7 @@ void qword_addhex(char **bpp, int *lp, char *buf, int blen)
1017 *bpp = bp; 1017 *bpp = bp;
1018 *lp = len; 1018 *lp = len;
1019} 1019}
1020EXPORT_SYMBOL(qword_addhex); 1020EXPORT_SYMBOL_GPL(qword_addhex);
1021 1021
1022static void warn_no_listener(struct cache_detail *detail) 1022static void warn_no_listener(struct cache_detail *detail)
1023{ 1023{
@@ -1140,7 +1140,7 @@ int qword_get(char **bpp, char *dest, int bufsize)
1140 *dest = '\0'; 1140 *dest = '\0';
1141 return len; 1141 return len;
1142} 1142}
1143EXPORT_SYMBOL(qword_get); 1143EXPORT_SYMBOL_GPL(qword_get);
1144 1144
1145 1145
1146/* 1146/*
diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c
index 50b049c6598a..085372ef4feb 100644
--- a/net/sunrpc/stats.c
+++ b/net/sunrpc/stats.c
@@ -106,7 +106,7 @@ void svc_seq_show(struct seq_file *seq, const struct svc_stat *statp) {
106 seq_putc(seq, '\n'); 106 seq_putc(seq, '\n');
107 } 107 }
108} 108}
109EXPORT_SYMBOL(svc_seq_show); 109EXPORT_SYMBOL_GPL(svc_seq_show);
110 110
111/** 111/**
112 * rpc_alloc_iostats - allocate an rpc_iostats structure 112 * rpc_alloc_iostats - allocate an rpc_iostats structure
@@ -249,14 +249,14 @@ svc_proc_register(struct svc_stat *statp, const struct file_operations *fops)
249{ 249{
250 return do_register(statp->program->pg_name, statp, fops); 250 return do_register(statp->program->pg_name, statp, fops);
251} 251}
252EXPORT_SYMBOL(svc_proc_register); 252EXPORT_SYMBOL_GPL(svc_proc_register);
253 253
254void 254void
255svc_proc_unregister(const char *name) 255svc_proc_unregister(const char *name)
256{ 256{
257 remove_proc_entry(name, proc_net_rpc); 257 remove_proc_entry(name, proc_net_rpc);
258} 258}
259EXPORT_SYMBOL(svc_proc_unregister); 259EXPORT_SYMBOL_GPL(svc_proc_unregister);
260 260
261void 261void
262rpc_proc_init(void) 262rpc_proc_init(void)
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 54c98d876847..c51fed4d1af1 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -431,7 +431,7 @@ svc_create(struct svc_program *prog, unsigned int bufsize,
431{ 431{
432 return __svc_create(prog, bufsize, /*npools*/1, family, shutdown); 432 return __svc_create(prog, bufsize, /*npools*/1, family, shutdown);
433} 433}
434EXPORT_SYMBOL(svc_create); 434EXPORT_SYMBOL_GPL(svc_create);
435 435
436struct svc_serv * 436struct svc_serv *
437svc_create_pooled(struct svc_program *prog, unsigned int bufsize, 437svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
@@ -450,7 +450,7 @@ svc_create_pooled(struct svc_program *prog, unsigned int bufsize,
450 450
451 return serv; 451 return serv;
452} 452}
453EXPORT_SYMBOL(svc_create_pooled); 453EXPORT_SYMBOL_GPL(svc_create_pooled);
454 454
455/* 455/*
456 * Destroy an RPC service. Should be called with appropriate locking to 456 * Destroy an RPC service. Should be called with appropriate locking to
@@ -492,7 +492,7 @@ svc_destroy(struct svc_serv *serv)
492 kfree(serv->sv_pools); 492 kfree(serv->sv_pools);
493 kfree(serv); 493 kfree(serv);
494} 494}
495EXPORT_SYMBOL(svc_destroy); 495EXPORT_SYMBOL_GPL(svc_destroy);
496 496
497/* 497/*
498 * Allocate an RPC server's buffer space. 498 * Allocate an RPC server's buffer space.
@@ -567,7 +567,7 @@ out_thread:
567out_enomem: 567out_enomem:
568 return ERR_PTR(-ENOMEM); 568 return ERR_PTR(-ENOMEM);
569} 569}
570EXPORT_SYMBOL(svc_prepare_thread); 570EXPORT_SYMBOL_GPL(svc_prepare_thread);
571 571
572/* 572/*
573 * Choose a pool in which to create a new thread, for svc_set_num_threads 573 * Choose a pool in which to create a new thread, for svc_set_num_threads
@@ -689,7 +689,7 @@ svc_set_num_threads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
689 689
690 return error; 690 return error;
691} 691}
692EXPORT_SYMBOL(svc_set_num_threads); 692EXPORT_SYMBOL_GPL(svc_set_num_threads);
693 693
694/* 694/*
695 * Called from a server thread as it's exiting. Caller must hold the BKL or 695 * Called from a server thread as it's exiting. Caller must hold the BKL or
@@ -717,7 +717,7 @@ svc_exit_thread(struct svc_rqst *rqstp)
717 if (serv) 717 if (serv)
718 svc_destroy(serv); 718 svc_destroy(serv);
719} 719}
720EXPORT_SYMBOL(svc_exit_thread); 720EXPORT_SYMBOL_GPL(svc_exit_thread);
721 721
722#ifdef CONFIG_SUNRPC_REGISTER_V4 722#ifdef CONFIG_SUNRPC_REGISTER_V4
723 723
@@ -1231,7 +1231,7 @@ err_bad:
1231 svc_putnl(resv, ntohl(rpc_stat)); 1231 svc_putnl(resv, ntohl(rpc_stat));
1232 goto sendit; 1232 goto sendit;
1233} 1233}
1234EXPORT_SYMBOL(svc_process); 1234EXPORT_SYMBOL_GPL(svc_process);
1235 1235
1236/* 1236/*
1237 * Return (transport-specific) limit on the rpc payload. 1237 * Return (transport-specific) limit on the rpc payload.
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index bf5b5cdafebf..e588df5d6b34 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -440,7 +440,7 @@ void svc_reserve(struct svc_rqst *rqstp, int space)
440 svc_xprt_enqueue(xprt); 440 svc_xprt_enqueue(xprt);
441 } 441 }
442} 442}
443EXPORT_SYMBOL(svc_reserve); 443EXPORT_SYMBOL_GPL(svc_reserve);
444 444
445static void svc_xprt_release(struct svc_rqst *rqstp) 445static void svc_xprt_release(struct svc_rqst *rqstp)
446{ 446{
@@ -448,6 +448,9 @@ static void svc_xprt_release(struct svc_rqst *rqstp)
448 448
449 rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp); 449 rqstp->rq_xprt->xpt_ops->xpo_release_rqst(rqstp);
450 450
451 kfree(rqstp->rq_deferred);
452 rqstp->rq_deferred = NULL;
453
451 svc_free_res_pages(rqstp); 454 svc_free_res_pages(rqstp);
452 rqstp->rq_res.page_len = 0; 455 rqstp->rq_res.page_len = 0;
453 rqstp->rq_res.page_base = 0; 456 rqstp->rq_res.page_base = 0;
@@ -498,7 +501,7 @@ void svc_wake_up(struct svc_serv *serv)
498 spin_unlock_bh(&pool->sp_lock); 501 spin_unlock_bh(&pool->sp_lock);
499 } 502 }
500} 503}
501EXPORT_SYMBOL(svc_wake_up); 504EXPORT_SYMBOL_GPL(svc_wake_up);
502 505
503int svc_port_is_privileged(struct sockaddr *sin) 506int svc_port_is_privileged(struct sockaddr *sin)
504{ 507{
@@ -515,8 +518,10 @@ int svc_port_is_privileged(struct sockaddr *sin)
515} 518}
516 519
517/* 520/*
518 * Make sure that we don't have too many active connections. If we 521 * Make sure that we don't have too many active connections. If we have,
519 * have, something must be dropped. 522 * something must be dropped. It's not clear what will happen if we allow
523 * "too many" connections, but when dealing with network-facing software,
524 * we have to code defensively. Here we do that by imposing hard limits.
520 * 525 *
521 * There's no point in trying to do random drop here for DoS 526 * There's no point in trying to do random drop here for DoS
522 * prevention. The NFS clients does 1 reconnect in 15 seconds. An 527 * prevention. The NFS clients does 1 reconnect in 15 seconds. An
@@ -525,19 +530,27 @@ int svc_port_is_privileged(struct sockaddr *sin)
525 * The only somewhat efficient mechanism would be if drop old 530 * The only somewhat efficient mechanism would be if drop old
526 * connections from the same IP first. But right now we don't even 531 * connections from the same IP first. But right now we don't even
527 * record the client IP in svc_sock. 532 * record the client IP in svc_sock.
533 *
534 * single-threaded services that expect a lot of clients will probably
535 * need to set sv_maxconn to override the default value which is based
536 * on the number of threads
528 */ 537 */
529static void svc_check_conn_limits(struct svc_serv *serv) 538static void svc_check_conn_limits(struct svc_serv *serv)
530{ 539{
531 if (serv->sv_tmpcnt > (serv->sv_nrthreads+3)*20) { 540 unsigned int limit = serv->sv_maxconn ? serv->sv_maxconn :
541 (serv->sv_nrthreads+3) * 20;
542
543 if (serv->sv_tmpcnt > limit) {
532 struct svc_xprt *xprt = NULL; 544 struct svc_xprt *xprt = NULL;
533 spin_lock_bh(&serv->sv_lock); 545 spin_lock_bh(&serv->sv_lock);
534 if (!list_empty(&serv->sv_tempsocks)) { 546 if (!list_empty(&serv->sv_tempsocks)) {
535 if (net_ratelimit()) { 547 if (net_ratelimit()) {
536 /* Try to help the admin */ 548 /* Try to help the admin */
537 printk(KERN_NOTICE "%s: too many open " 549 printk(KERN_NOTICE "%s: too many open "
538 "connections, consider increasing the " 550 "connections, consider increasing %s\n",
539 "number of nfsd threads\n", 551 serv->sv_name, serv->sv_maxconn ?
540 serv->sv_name); 552 "the max number of connections." :
553 "the number of threads.");
541 } 554 }
542 /* 555 /*
543 * Always select the oldest connection. It's not fair, 556 * Always select the oldest connection. It's not fair,
@@ -730,7 +743,7 @@ int svc_recv(struct svc_rqst *rqstp, long timeout)
730 serv->sv_stats->netcnt++; 743 serv->sv_stats->netcnt++;
731 return len; 744 return len;
732} 745}
733EXPORT_SYMBOL(svc_recv); 746EXPORT_SYMBOL_GPL(svc_recv);
734 747
735/* 748/*
736 * Drop request 749 * Drop request
@@ -740,7 +753,7 @@ void svc_drop(struct svc_rqst *rqstp)
740 dprintk("svc: xprt %p dropped request\n", rqstp->rq_xprt); 753 dprintk("svc: xprt %p dropped request\n", rqstp->rq_xprt);
741 svc_xprt_release(rqstp); 754 svc_xprt_release(rqstp);
742} 755}
743EXPORT_SYMBOL(svc_drop); 756EXPORT_SYMBOL_GPL(svc_drop);
744 757
745/* 758/*
746 * Return reply to client. 759 * Return reply to client.
@@ -837,6 +850,11 @@ static void svc_age_temp_xprts(unsigned long closure)
837void svc_delete_xprt(struct svc_xprt *xprt) 850void svc_delete_xprt(struct svc_xprt *xprt)
838{ 851{
839 struct svc_serv *serv = xprt->xpt_server; 852 struct svc_serv *serv = xprt->xpt_server;
853 struct svc_deferred_req *dr;
854
855 /* Only do this once */
856 if (test_and_set_bit(XPT_DEAD, &xprt->xpt_flags))
857 return;
840 858
841 dprintk("svc: svc_delete_xprt(%p)\n", xprt); 859 dprintk("svc: svc_delete_xprt(%p)\n", xprt);
842 xprt->xpt_ops->xpo_detach(xprt); 860 xprt->xpt_ops->xpo_detach(xprt);
@@ -851,12 +869,16 @@ void svc_delete_xprt(struct svc_xprt *xprt)
851 * while still attached to a queue, the queue itself 869 * while still attached to a queue, the queue itself
852 * is about to be destroyed (in svc_destroy). 870 * is about to be destroyed (in svc_destroy).
853 */ 871 */
854 if (!test_and_set_bit(XPT_DEAD, &xprt->xpt_flags)) { 872 if (test_bit(XPT_TEMP, &xprt->xpt_flags))
855 BUG_ON(atomic_read(&xprt->xpt_ref.refcount) < 2); 873 serv->sv_tmpcnt--;
856 if (test_bit(XPT_TEMP, &xprt->xpt_flags)) 874
857 serv->sv_tmpcnt--; 875 for (dr = svc_deferred_dequeue(xprt); dr;
876 dr = svc_deferred_dequeue(xprt)) {
858 svc_xprt_put(xprt); 877 svc_xprt_put(xprt);
878 kfree(dr);
859 } 879 }
880
881 svc_xprt_put(xprt);
860 spin_unlock_bh(&serv->sv_lock); 882 spin_unlock_bh(&serv->sv_lock);
861} 883}
862 884
@@ -902,17 +924,19 @@ static void svc_revisit(struct cache_deferred_req *dreq, int too_many)
902 container_of(dreq, struct svc_deferred_req, handle); 924 container_of(dreq, struct svc_deferred_req, handle);
903 struct svc_xprt *xprt = dr->xprt; 925 struct svc_xprt *xprt = dr->xprt;
904 926
905 if (too_many) { 927 spin_lock(&xprt->xpt_lock);
928 set_bit(XPT_DEFERRED, &xprt->xpt_flags);
929 if (too_many || test_bit(XPT_DEAD, &xprt->xpt_flags)) {
930 spin_unlock(&xprt->xpt_lock);
931 dprintk("revisit canceled\n");
906 svc_xprt_put(xprt); 932 svc_xprt_put(xprt);
907 kfree(dr); 933 kfree(dr);
908 return; 934 return;
909 } 935 }
910 dprintk("revisit queued\n"); 936 dprintk("revisit queued\n");
911 dr->xprt = NULL; 937 dr->xprt = NULL;
912 spin_lock(&xprt->xpt_lock);
913 list_add(&dr->handle.recent, &xprt->xpt_deferred); 938 list_add(&dr->handle.recent, &xprt->xpt_deferred);
914 spin_unlock(&xprt->xpt_lock); 939 spin_unlock(&xprt->xpt_lock);
915 set_bit(XPT_DEFERRED, &xprt->xpt_flags);
916 svc_xprt_enqueue(xprt); 940 svc_xprt_enqueue(xprt);
917 svc_xprt_put(xprt); 941 svc_xprt_put(xprt);
918} 942}
diff --git a/net/sunrpc/svcauth.c b/net/sunrpc/svcauth.c
index 8a73cbb16052..e64109b02aee 100644
--- a/net/sunrpc/svcauth.c
+++ b/net/sunrpc/svcauth.c
@@ -57,13 +57,13 @@ svc_authenticate(struct svc_rqst *rqstp, __be32 *authp)
57 rqstp->rq_authop = aops; 57 rqstp->rq_authop = aops;
58 return aops->accept(rqstp, authp); 58 return aops->accept(rqstp, authp);
59} 59}
60EXPORT_SYMBOL(svc_authenticate); 60EXPORT_SYMBOL_GPL(svc_authenticate);
61 61
62int svc_set_client(struct svc_rqst *rqstp) 62int svc_set_client(struct svc_rqst *rqstp)
63{ 63{
64 return rqstp->rq_authop->set_client(rqstp); 64 return rqstp->rq_authop->set_client(rqstp);
65} 65}
66EXPORT_SYMBOL(svc_set_client); 66EXPORT_SYMBOL_GPL(svc_set_client);
67 67
68/* A request, which was authenticated, has now executed. 68/* A request, which was authenticated, has now executed.
69 * Time to finalise the credentials and verifier 69 * Time to finalise the credentials and verifier
@@ -95,7 +95,7 @@ svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops)
95 spin_unlock(&authtab_lock); 95 spin_unlock(&authtab_lock);
96 return rv; 96 return rv;
97} 97}
98EXPORT_SYMBOL(svc_auth_register); 98EXPORT_SYMBOL_GPL(svc_auth_register);
99 99
100void 100void
101svc_auth_unregister(rpc_authflavor_t flavor) 101svc_auth_unregister(rpc_authflavor_t flavor)
@@ -105,7 +105,7 @@ svc_auth_unregister(rpc_authflavor_t flavor)
105 authtab[flavor] = NULL; 105 authtab[flavor] = NULL;
106 spin_unlock(&authtab_lock); 106 spin_unlock(&authtab_lock);
107} 107}
108EXPORT_SYMBOL(svc_auth_unregister); 108EXPORT_SYMBOL_GPL(svc_auth_unregister);
109 109
110/************************************************** 110/**************************************************
111 * 'auth_domains' are stored in a hash table indexed by name. 111 * 'auth_domains' are stored in a hash table indexed by name.
@@ -132,7 +132,7 @@ void auth_domain_put(struct auth_domain *dom)
132 spin_unlock(&auth_domain_lock); 132 spin_unlock(&auth_domain_lock);
133 } 133 }
134} 134}
135EXPORT_SYMBOL(auth_domain_put); 135EXPORT_SYMBOL_GPL(auth_domain_put);
136 136
137struct auth_domain * 137struct auth_domain *
138auth_domain_lookup(char *name, struct auth_domain *new) 138auth_domain_lookup(char *name, struct auth_domain *new)
@@ -157,10 +157,10 @@ auth_domain_lookup(char *name, struct auth_domain *new)
157 spin_unlock(&auth_domain_lock); 157 spin_unlock(&auth_domain_lock);
158 return new; 158 return new;
159} 159}
160EXPORT_SYMBOL(auth_domain_lookup); 160EXPORT_SYMBOL_GPL(auth_domain_lookup);
161 161
162struct auth_domain *auth_domain_find(char *name) 162struct auth_domain *auth_domain_find(char *name)
163{ 163{
164 return auth_domain_lookup(name, NULL); 164 return auth_domain_lookup(name, NULL);
165} 165}
166EXPORT_SYMBOL(auth_domain_find); 166EXPORT_SYMBOL_GPL(auth_domain_find);
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index 82240e6127b2..5c865e2d299e 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -64,7 +64,7 @@ struct auth_domain *unix_domain_find(char *name)
64 rv = auth_domain_lookup(name, &new->h); 64 rv = auth_domain_lookup(name, &new->h);
65 } 65 }
66} 66}
67EXPORT_SYMBOL(unix_domain_find); 67EXPORT_SYMBOL_GPL(unix_domain_find);
68 68
69static void svcauth_unix_domain_release(struct auth_domain *dom) 69static void svcauth_unix_domain_release(struct auth_domain *dom)
70{ 70{
@@ -358,7 +358,7 @@ int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom)
358 else 358 else
359 return -ENOMEM; 359 return -ENOMEM;
360} 360}
361EXPORT_SYMBOL(auth_unix_add_addr); 361EXPORT_SYMBOL_GPL(auth_unix_add_addr);
362 362
363int auth_unix_forget_old(struct auth_domain *dom) 363int auth_unix_forget_old(struct auth_domain *dom)
364{ 364{
@@ -370,7 +370,7 @@ int auth_unix_forget_old(struct auth_domain *dom)
370 udom->addr_changes++; 370 udom->addr_changes++;
371 return 0; 371 return 0;
372} 372}
373EXPORT_SYMBOL(auth_unix_forget_old); 373EXPORT_SYMBOL_GPL(auth_unix_forget_old);
374 374
375struct auth_domain *auth_unix_lookup(struct in6_addr *addr) 375struct auth_domain *auth_unix_lookup(struct in6_addr *addr)
376{ 376{
@@ -395,13 +395,13 @@ struct auth_domain *auth_unix_lookup(struct in6_addr *addr)
395 cache_put(&ipm->h, &ip_map_cache); 395 cache_put(&ipm->h, &ip_map_cache);
396 return rv; 396 return rv;
397} 397}
398EXPORT_SYMBOL(auth_unix_lookup); 398EXPORT_SYMBOL_GPL(auth_unix_lookup);
399 399
400void svcauth_unix_purge(void) 400void svcauth_unix_purge(void)
401{ 401{
402 cache_purge(&ip_map_cache); 402 cache_purge(&ip_map_cache);
403} 403}
404EXPORT_SYMBOL(svcauth_unix_purge); 404EXPORT_SYMBOL_GPL(svcauth_unix_purge);
405 405
406static inline struct ip_map * 406static inline struct ip_map *
407ip_map_cached_get(struct svc_rqst *rqstp) 407ip_map_cached_get(struct svc_rqst *rqstp)
@@ -714,7 +714,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp)
714 return SVC_OK; 714 return SVC_OK;
715} 715}
716 716
717EXPORT_SYMBOL(svcauth_unix_set_client); 717EXPORT_SYMBOL_GPL(svcauth_unix_set_client);
718 718
719static int 719static int
720svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp) 720svcauth_null_accept(struct svc_rqst *rqstp, __be32 *authp)
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index ef3238d665ee..5763e6460fea 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -59,6 +59,7 @@ static void svc_udp_data_ready(struct sock *, int);
59static int svc_udp_recvfrom(struct svc_rqst *); 59static int svc_udp_recvfrom(struct svc_rqst *);
60static int svc_udp_sendto(struct svc_rqst *); 60static int svc_udp_sendto(struct svc_rqst *);
61static void svc_sock_detach(struct svc_xprt *); 61static void svc_sock_detach(struct svc_xprt *);
62static void svc_tcp_sock_detach(struct svc_xprt *);
62static void svc_sock_free(struct svc_xprt *); 63static void svc_sock_free(struct svc_xprt *);
63 64
64static struct svc_xprt *svc_create_socket(struct svc_serv *, int, 65static struct svc_xprt *svc_create_socket(struct svc_serv *, int,
@@ -102,7 +103,6 @@ static void svc_reclassify_socket(struct socket *sock)
102static void svc_release_skb(struct svc_rqst *rqstp) 103static void svc_release_skb(struct svc_rqst *rqstp)
103{ 104{
104 struct sk_buff *skb = rqstp->rq_xprt_ctxt; 105 struct sk_buff *skb = rqstp->rq_xprt_ctxt;
105 struct svc_deferred_req *dr = rqstp->rq_deferred;
106 106
107 if (skb) { 107 if (skb) {
108 struct svc_sock *svsk = 108 struct svc_sock *svsk =
@@ -112,10 +112,6 @@ static void svc_release_skb(struct svc_rqst *rqstp)
112 dprintk("svc: service %p, releasing skb %p\n", rqstp, skb); 112 dprintk("svc: service %p, releasing skb %p\n", rqstp, skb);
113 skb_free_datagram(svsk->sk_sk, skb); 113 skb_free_datagram(svsk->sk_sk, skb);
114 } 114 }
115 if (dr) {
116 rqstp->rq_deferred = NULL;
117 kfree(dr);
118 }
119} 115}
120 116
121union svc_pktinfo_u { 117union svc_pktinfo_u {
@@ -289,7 +285,7 @@ svc_sock_names(char *buf, struct svc_serv *serv, char *toclose)
289 return -ENOENT; 285 return -ENOENT;
290 return len; 286 return len;
291} 287}
292EXPORT_SYMBOL(svc_sock_names); 288EXPORT_SYMBOL_GPL(svc_sock_names);
293 289
294/* 290/*
295 * Check input queue length 291 * Check input queue length
@@ -1017,7 +1013,7 @@ static struct svc_xprt_ops svc_tcp_ops = {
1017 .xpo_recvfrom = svc_tcp_recvfrom, 1013 .xpo_recvfrom = svc_tcp_recvfrom,
1018 .xpo_sendto = svc_tcp_sendto, 1014 .xpo_sendto = svc_tcp_sendto,
1019 .xpo_release_rqst = svc_release_skb, 1015 .xpo_release_rqst = svc_release_skb,
1020 .xpo_detach = svc_sock_detach, 1016 .xpo_detach = svc_tcp_sock_detach,
1021 .xpo_free = svc_sock_free, 1017 .xpo_free = svc_sock_free,
1022 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr, 1018 .xpo_prep_reply_hdr = svc_tcp_prep_reply_hdr,
1023 .xpo_has_wspace = svc_tcp_has_wspace, 1019 .xpo_has_wspace = svc_tcp_has_wspace,
@@ -1101,7 +1097,7 @@ void svc_sock_update_bufs(struct svc_serv *serv)
1101 } 1097 }
1102 spin_unlock_bh(&serv->sv_lock); 1098 spin_unlock_bh(&serv->sv_lock);
1103} 1099}
1104EXPORT_SYMBOL(svc_sock_update_bufs); 1100EXPORT_SYMBOL_GPL(svc_sock_update_bufs);
1105 1101
1106/* 1102/*
1107 * Initialize socket for RPC use and create svc_sock struct 1103 * Initialize socket for RPC use and create svc_sock struct
@@ -1287,6 +1283,24 @@ static void svc_sock_detach(struct svc_xprt *xprt)
1287 sk->sk_state_change = svsk->sk_ostate; 1283 sk->sk_state_change = svsk->sk_ostate;
1288 sk->sk_data_ready = svsk->sk_odata; 1284 sk->sk_data_ready = svsk->sk_odata;
1289 sk->sk_write_space = svsk->sk_owspace; 1285 sk->sk_write_space = svsk->sk_owspace;
1286
1287 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
1288 wake_up_interruptible(sk->sk_sleep);
1289}
1290
1291/*
1292 * Disconnect the socket, and reset the callbacks
1293 */
1294static void svc_tcp_sock_detach(struct svc_xprt *xprt)
1295{
1296 struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
1297
1298 dprintk("svc: svc_tcp_sock_detach(%p)\n", svsk);
1299
1300 svc_sock_detach(xprt);
1301
1302 if (!test_bit(XPT_LISTENER, &xprt->xpt_flags))
1303 kernel_sock_shutdown(svsk->sk_sock, SHUT_RDWR);
1290} 1304}
1291 1305
1292/* 1306/*