diff options
author | J. Bruce Fields <bfields@redhat.com> | 2010-12-17 13:29:07 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-12-17 13:29:07 -0500 |
commit | ec66ee3797e5848356cf593c6ec7aabf30a00cf1 (patch) | |
tree | 7ed5c84cc914644ffa1cd1b6a2b45db53fc224e8 /net/sunrpc/svc_xprt.c | |
parent | 1205065764f2eda3216ebe213143f69891ee3460 (diff) | |
parent | b0c3844d8af6b9f3f18f31e1b0502fbefa2166be (diff) |
Merge commit 'v2.6.37-rc6' into for-2.6.38
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index b6f47da170b3..5a75d23645c8 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -5,7 +5,6 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/smp_lock.h> | ||
9 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
10 | #include <linux/freezer.h> | 9 | #include <linux/freezer.h> |
11 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
@@ -213,6 +212,7 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
213 | spin_lock(&svc_xprt_class_lock); | 212 | spin_lock(&svc_xprt_class_lock); |
214 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { | 213 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { |
215 | struct svc_xprt *newxprt; | 214 | struct svc_xprt *newxprt; |
215 | unsigned short newport; | ||
216 | 216 | ||
217 | if (strcmp(xprt_name, xcl->xcl_name)) | 217 | if (strcmp(xprt_name, xcl->xcl_name)) |
218 | continue; | 218 | continue; |
@@ -231,8 +231,9 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
231 | spin_lock_bh(&serv->sv_lock); | 231 | spin_lock_bh(&serv->sv_lock); |
232 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); | 232 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); |
233 | spin_unlock_bh(&serv->sv_lock); | 233 | spin_unlock_bh(&serv->sv_lock); |
234 | newport = svc_xprt_local_port(newxprt); | ||
234 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); | 235 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); |
235 | return svc_xprt_local_port(newxprt); | 236 | return newport; |
236 | } | 237 | } |
237 | err: | 238 | err: |
238 | spin_unlock(&svc_xprt_class_lock); | 239 | spin_unlock(&svc_xprt_class_lock); |
@@ -415,8 +416,13 @@ void svc_xprt_received(struct svc_xprt *xprt) | |||
415 | { | 416 | { |
416 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); | 417 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); |
417 | xprt->xpt_pool = NULL; | 418 | xprt->xpt_pool = NULL; |
419 | /* As soon as we clear busy, the xprt could be closed and | ||
420 | * 'put', so we need a reference to call svc_xprt_enqueue with: | ||
421 | */ | ||
422 | svc_xprt_get(xprt); | ||
418 | clear_bit(XPT_BUSY, &xprt->xpt_flags); | 423 | clear_bit(XPT_BUSY, &xprt->xpt_flags); |
419 | svc_xprt_enqueue(xprt); | 424 | svc_xprt_enqueue(xprt); |
425 | svc_xprt_put(xprt); | ||
420 | } | 426 | } |
421 | EXPORT_SYMBOL_GPL(svc_xprt_received); | 427 | EXPORT_SYMBOL_GPL(svc_xprt_received); |
422 | 428 | ||