aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 01:49:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-26 01:49:19 -0400
commit2dad3206db5c3832cde1f58650027fea3ff7adf3 (patch)
tree96314a554afdab5904a939793156d4ae23ec11c1 /net
parent84635d68be4b846ba984a89f386524153330c597 (diff)
parent0c12eaffdf09466f36a9ffe970dda8f4aeb6efc0 (diff)
Merge branch 'for-3.1' of git://linux-nfs.org/~bfields/linux
* 'for-3.1' of git://linux-nfs.org/~bfields/linux: nfsd: don't break lease on CLAIM_DELEGATE_CUR locks: rename lock-manager ops nfsd4: update nfsv4.1 implementation notes nfsd: turn on reply cache for NFSv4 nfsd4: call nfsd4_release_compoundargs from pc_release nfsd41: Deny new lock before RECLAIM_COMPLETE done fs: locks: remove init_once nfsd41: check the size of request nfsd41: error out when client sets maxreq_sz or maxresp_sz too small nfsd4: fix file leak on open_downgrade nfsd4: remember to put RW access on stateid destruction NFSD: Added TEST_STATEID operation NFSD: added FREE_STATEID operation svcrpc: fix list-corrupting race on nfsd shutdown rpc: allow autoloading of gss mechanisms svcauth_unix.c: quiet sparse noise svcsock.c: include sunrpc.h to quiet sparse noise nfsd: Remove deprecated nfsctl system call and related code. NFSD: allow OP_DESTROY_CLIENTID to be only op in COMPOUND Fix up trivial conflicts in Documentation/feature-removal-schedule.txt
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c7
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c32
-rw-r--r--net/sunrpc/svc_xprt.c11
-rw-r--r--net/sunrpc/svcauth_unix.c79
-rw-r--r--net/sunrpc/svcsock.c2
5 files changed, 44 insertions, 87 deletions
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index c3b75333b821..8c67890de427 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -744,6 +744,13 @@ static struct pf_desc gss_kerberos_pfs[] = {
744 }, 744 },
745}; 745};
746 746
747MODULE_ALIAS("rpc-auth-gss-krb5");
748MODULE_ALIAS("rpc-auth-gss-krb5i");
749MODULE_ALIAS("rpc-auth-gss-krb5p");
750MODULE_ALIAS("rpc-auth-gss-390003");
751MODULE_ALIAS("rpc-auth-gss-390004");
752MODULE_ALIAS("rpc-auth-gss-390005");
753
747static struct gss_api_mech gss_kerberos_mech = { 754static struct gss_api_mech gss_kerberos_mech = {
748 .gm_name = "krb5", 755 .gm_name = "krb5",
749 .gm_owner = THIS_MODULE, 756 .gm_owner = THIS_MODULE,
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index e3c36a274412..ca8cad8251c7 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -141,7 +141,7 @@ gss_mech_get(struct gss_api_mech *gm)
141EXPORT_SYMBOL_GPL(gss_mech_get); 141EXPORT_SYMBOL_GPL(gss_mech_get);
142 142
143struct gss_api_mech * 143struct gss_api_mech *
144gss_mech_get_by_name(const char *name) 144_gss_mech_get_by_name(const char *name)
145{ 145{
146 struct gss_api_mech *pos, *gm = NULL; 146 struct gss_api_mech *pos, *gm = NULL;
147 147
@@ -158,6 +158,17 @@ gss_mech_get_by_name(const char *name)
158 158
159} 159}
160 160
161struct gss_api_mech * gss_mech_get_by_name(const char *name)
162{
163 struct gss_api_mech *gm = NULL;
164
165 gm = _gss_mech_get_by_name(name);
166 if (!gm) {
167 request_module("rpc-auth-gss-%s", name);
168 gm = _gss_mech_get_by_name(name);
169 }
170 return gm;
171}
161EXPORT_SYMBOL_GPL(gss_mech_get_by_name); 172EXPORT_SYMBOL_GPL(gss_mech_get_by_name);
162 173
163struct gss_api_mech * 174struct gss_api_mech *
@@ -194,10 +205,9 @@ mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor)
194 return 0; 205 return 0;
195} 206}
196 207
197struct gss_api_mech * 208struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
198gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
199{ 209{
200 struct gss_api_mech *pos, *gm = NULL; 210 struct gss_api_mech *gm = NULL, *pos;
201 211
202 spin_lock(&registered_mechs_lock); 212 spin_lock(&registered_mechs_lock);
203 list_for_each_entry(pos, &registered_mechs, gm_list) { 213 list_for_each_entry(pos, &registered_mechs, gm_list) {
@@ -213,6 +223,20 @@ gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
213 return gm; 223 return gm;
214} 224}
215 225
226struct gss_api_mech *
227gss_mech_get_by_pseudoflavor(u32 pseudoflavor)
228{
229 struct gss_api_mech *gm;
230
231 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
232
233 if (!gm) {
234 request_module("rpc-auth-gss-%u", pseudoflavor);
235 gm = _gss_mech_get_by_pseudoflavor(pseudoflavor);
236 }
237 return gm;
238}
239
216EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor); 240EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor);
217 241
218int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) 242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c
index ab86b7927f84..bd31208bbb61 100644
--- a/net/sunrpc/svc_xprt.c
+++ b/net/sunrpc/svc_xprt.c
@@ -902,12 +902,13 @@ void svc_delete_xprt(struct svc_xprt *xprt)
902 if (!test_and_set_bit(XPT_DETACHED, &xprt->xpt_flags)) 902 if (!test_and_set_bit(XPT_DETACHED, &xprt->xpt_flags))
903 list_del_init(&xprt->xpt_list); 903 list_del_init(&xprt->xpt_list);
904 /* 904 /*
905 * We used to delete the transport from whichever list 905 * The only time we're called while xpt_ready is still on a list
906 * it's sk_xprt.xpt_ready node was on, but we don't actually 906 * is while the list itself is about to be destroyed (in
907 * need to. This is because the only time we're called 907 * svc_destroy). BUT svc_xprt_enqueue could still be attempting
908 * while still attached to a queue, the queue itself 908 * to add new entries to the sp_sockets list, so we can't leave
909 * is about to be destroyed (in svc_destroy). 909 * a freed xprt on it.
910 */ 910 */
911 list_del_init(&xprt->xpt_ready);
911 if (test_bit(XPT_TEMP, &xprt->xpt_flags)) 912 if (test_bit(XPT_TEMP, &xprt->xpt_flags))
912 serv->sv_tmpcnt--; 913 serv->sv_tmpcnt--;
913 spin_unlock_bh(&serv->sv_lock); 914 spin_unlock_bh(&serv->sv_lock);
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index c8e10216c113..ce136323da8b 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -30,12 +30,10 @@
30 30
31struct unix_domain { 31struct unix_domain {
32 struct auth_domain h; 32 struct auth_domain h;
33#ifdef CONFIG_NFSD_DEPRECATED
34 int addr_changes;
35#endif /* CONFIG_NFSD_DEPRECATED */
36 /* other stuff later */ 33 /* other stuff later */
37}; 34};
38 35
36extern struct auth_ops svcauth_null;
39extern struct auth_ops svcauth_unix; 37extern struct auth_ops svcauth_unix;
40 38
41static void svcauth_unix_domain_release(struct auth_domain *dom) 39static void svcauth_unix_domain_release(struct auth_domain *dom)
@@ -74,9 +72,6 @@ struct auth_domain *unix_domain_find(char *name)
74 return NULL; 72 return NULL;
75 } 73 }
76 new->h.flavour = &svcauth_unix; 74 new->h.flavour = &svcauth_unix;
77#ifdef CONFIG_NFSD_DEPRECATED
78 new->addr_changes = 0;
79#endif /* CONFIG_NFSD_DEPRECATED */
80 rv = auth_domain_lookup(name, &new->h); 75 rv = auth_domain_lookup(name, &new->h);
81 } 76 }
82} 77}
@@ -95,9 +90,6 @@ struct ip_map {
95 char m_class[8]; /* e.g. "nfsd" */ 90 char m_class[8]; /* e.g. "nfsd" */
96 struct in6_addr m_addr; 91 struct in6_addr m_addr;
97 struct unix_domain *m_client; 92 struct unix_domain *m_client;
98#ifdef CONFIG_NFSD_DEPRECATED
99 int m_add_change;
100#endif /* CONFIG_NFSD_DEPRECATED */
101}; 93};
102 94
103static void ip_map_put(struct kref *kref) 95static void ip_map_put(struct kref *kref)
@@ -151,9 +143,6 @@ static void update(struct cache_head *cnew, struct cache_head *citem)
151 143
152 kref_get(&item->m_client->h.ref); 144 kref_get(&item->m_client->h.ref);
153 new->m_client = item->m_client; 145 new->m_client = item->m_client;
154#ifdef CONFIG_NFSD_DEPRECATED
155 new->m_add_change = item->m_add_change;
156#endif /* CONFIG_NFSD_DEPRECATED */
157} 146}
158static struct cache_head *ip_map_alloc(void) 147static struct cache_head *ip_map_alloc(void)
159{ 148{
@@ -338,16 +327,6 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
338 ip.h.flags = 0; 327 ip.h.flags = 0;
339 if (!udom) 328 if (!udom)
340 set_bit(CACHE_NEGATIVE, &ip.h.flags); 329 set_bit(CACHE_NEGATIVE, &ip.h.flags);
341#ifdef CONFIG_NFSD_DEPRECATED
342 else {
343 ip.m_add_change = udom->addr_changes;
344 /* if this is from the legacy set_client system call,
345 * we need m_add_change to be one higher
346 */
347 if (expiry == NEVER)
348 ip.m_add_change++;
349 }
350#endif /* CONFIG_NFSD_DEPRECATED */
351 ip.h.expiry_time = expiry; 330 ip.h.expiry_time = expiry;
352 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h, 331 ch = sunrpc_cache_update(cd, &ip.h, &ipm->h,
353 hash_str(ipm->m_class, IP_HASHBITS) ^ 332 hash_str(ipm->m_class, IP_HASHBITS) ^
@@ -367,62 +346,6 @@ static inline int ip_map_update(struct net *net, struct ip_map *ipm,
367 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry); 346 return __ip_map_update(sn->ip_map_cache, ipm, udom, expiry);
368} 347}
369 348
370#ifdef CONFIG_NFSD_DEPRECATED
371int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom)
372{
373 struct unix_domain *udom;
374 struct ip_map *ipmp;
375
376 if (dom->flavour != &svcauth_unix)
377 return -EINVAL;
378 udom = container_of(dom, struct unix_domain, h);
379 ipmp = ip_map_lookup(net, "nfsd", addr);
380
381 if (ipmp)
382 return ip_map_update(net, ipmp, udom, NEVER);
383 else
384 return -ENOMEM;
385}
386EXPORT_SYMBOL_GPL(auth_unix_add_addr);
387
388int auth_unix_forget_old(struct auth_domain *dom)
389{
390 struct unix_domain *udom;
391
392 if (dom->flavour != &svcauth_unix)
393 return -EINVAL;
394 udom = container_of(dom, struct unix_domain, h);
395 udom->addr_changes++;
396 return 0;
397}
398EXPORT_SYMBOL_GPL(auth_unix_forget_old);
399
400struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr)
401{
402 struct ip_map *ipm;
403 struct auth_domain *rv;
404 struct sunrpc_net *sn;
405
406 sn = net_generic(net, sunrpc_net_id);
407 ipm = ip_map_lookup(net, "nfsd", addr);
408
409 if (!ipm)
410 return NULL;
411 if (cache_check(sn->ip_map_cache, &ipm->h, NULL))
412 return NULL;
413
414 if ((ipm->m_client->addr_changes - ipm->m_add_change) >0) {
415 sunrpc_invalidate(&ipm->h, sn->ip_map_cache);
416 rv = NULL;
417 } else {
418 rv = &ipm->m_client->h;
419 kref_get(&rv->ref);
420 }
421 cache_put(&ipm->h, sn->ip_map_cache);
422 return rv;
423}
424EXPORT_SYMBOL_GPL(auth_unix_lookup);
425#endif /* CONFIG_NFSD_DEPRECATED */
426 349
427void svcauth_unix_purge(void) 350void svcauth_unix_purge(void)
428{ 351{
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index af04f779ce9f..f2cb5b881dea 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -51,6 +51,8 @@
51#include <linux/sunrpc/stats.h> 51#include <linux/sunrpc/stats.h>
52#include <linux/sunrpc/xprt.h> 52#include <linux/sunrpc/xprt.h>
53 53
54#include "sunrpc.h"
55
54#define RPCDBG_FACILITY RPCDBG_SVCXPRT 56#define RPCDBG_FACILITY RPCDBG_SVCXPRT
55 57
56 58