diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:23:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 12:23:01 -0500 |
commit | 2171ee8f43968e8d6a2b4712d495e352e881c446 (patch) | |
tree | 354078e804c9d721b246c99f1c272d85b92acfb1 /net | |
parent | 9b9a72a8a370a1397fbb153d107e0d9fa8affb48 (diff) | |
parent | 666b3d803a511fbc9bc5e5ea8ce66010cf03ea13 (diff) |
Merge tag 'nfs-for-3.9-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client bugfixes from Trond Myklebust:
- Fix an Oops in the pNFS layoutget code
- Fix a number of NFSv4 and v4.1 state recovery deadlocks and hangs due
to the interaction of the session drain lock and state management
locks.
- Remove task->tk_xprt, which was hiding a lot of RCU dereferencing
bugs
- Fix a long standing NFSv3 posix lock recovery bug.
- Revert commit 324d003b0cd8 ("NFS: add nfs_sb_deactive_async to avoid
deadlock"). It turned out that the root cause of the deadlock was
due to interactions with the workqueues that have now been resolved.
* tag 'nfs-for-3.9-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (22 commits)
NLM: Ensure that we resend all pending blocking locks after a reclaim
umount oops when remove blocklayoutdriver first
sunrpc: silence build warning in gss_fill_context
nfs: remove kfree() redundant null checks
NFSv4.1: Don't decode skipped layoutgets
NFSv4.1: Fix bulk recall and destroy of layouts
NFSv4.1: Fix an ABBA locking issue with session and state serialisation
NFSv4: Fix a reboot recovery race when opening a file
NFSv4: Ensure delegation recall and byte range lock removal don't conflict
NFSv4: Fix up the return values of nfs4_open_delegation_recall
NFSv4.1: Don't lose locks when a server reboots during delegation return
NFSv4.1: Prevent deadlocks between state recovery and file locking
NFSv4: Allow the state manager to mark an open_owner as being recovered
SUNRPC: Add missing static declaration to _gss_mech_get_by_name
Revert "NFS: add nfs_sb_deactive_async to avoid deadlock"
SUNRPC: Nuke the tk_xprt macro
SUNRPC: Avoid RCU dereferences in the transport bind and connect code
SUNRPC: Fix an RCU dereference in xprt_reserve
SUNRPC: Pass pointers to struct rpc_xprt to the congestion window
SUNRPC: Fix an RCU dereference in xs_local_rpcbind
...
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/auth_gss/auth_gss.c | 5 | ||||
-rw-r--r-- | net/sunrpc/auth_gss/gss_mech_switch.c | 4 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 16 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 21 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 7 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 6 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 16 |
8 files changed, 42 insertions, 37 deletions
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 6e5c824b040b..911ef008b701 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -247,8 +247,7 @@ gss_fill_context(const void *p, const void *end, struct gss_cl_ctx *ctx, struct | |||
247 | __func__, ctx->gc_expiry, now, timeout); | 247 | __func__, ctx->gc_expiry, now, timeout); |
248 | return q; | 248 | return q; |
249 | err: | 249 | err: |
250 | dprintk("RPC: %s returns %ld gc_expiry %lu now %lu timeout %u\n", | 250 | dprintk("RPC: %s returns error %ld\n", __func__, -PTR_ERR(p)); |
251 | __func__, -PTR_ERR(p), ctx->gc_expiry, now, timeout); | ||
252 | return p; | 251 | return p; |
253 | } | 252 | } |
254 | 253 | ||
@@ -1154,7 +1153,7 @@ gss_marshal(struct rpc_task *task, __be32 *p) | |||
1154 | 1153 | ||
1155 | /* We compute the checksum for the verifier over the xdr-encoded bytes | 1154 | /* We compute the checksum for the verifier over the xdr-encoded bytes |
1156 | * starting with the xid and ending at the end of the credential: */ | 1155 | * starting with the xid and ending at the end of the credential: */ |
1157 | iov.iov_base = xprt_skip_transport_header(task->tk_xprt, | 1156 | iov.iov_base = xprt_skip_transport_header(req->rq_xprt, |
1158 | req->rq_snd_buf.head[0].iov_base); | 1157 | req->rq_snd_buf.head[0].iov_base); |
1159 | iov.iov_len = (u8 *)p - (u8 *)iov.iov_base; | 1158 | iov.iov_len = (u8 *)p - (u8 *)iov.iov_base; |
1160 | xdr_buf_from_iov(&iov, &verf_buf); | 1159 | xdr_buf_from_iov(&iov, &verf_buf); |
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c index b174fcd9ff4c..f0f4eee63a35 100644 --- a/net/sunrpc/auth_gss/gss_mech_switch.c +++ b/net/sunrpc/auth_gss/gss_mech_switch.c | |||
@@ -140,7 +140,7 @@ gss_mech_get(struct gss_api_mech *gm) | |||
140 | 140 | ||
141 | EXPORT_SYMBOL_GPL(gss_mech_get); | 141 | EXPORT_SYMBOL_GPL(gss_mech_get); |
142 | 142 | ||
143 | struct gss_api_mech * | 143 | static struct gss_api_mech * |
144 | _gss_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; |
@@ -205,7 +205,7 @@ mech_supports_pseudoflavor(struct gss_api_mech *gm, u32 pseudoflavor) | |||
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
208 | struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor) | 208 | static struct gss_api_mech *_gss_mech_get_by_pseudoflavor(u32 pseudoflavor) |
209 | { | 209 | { |
210 | struct gss_api_mech *gm = NULL, *pos; | 210 | struct gss_api_mech *gm = NULL, *pos; |
211 | 211 | ||
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 507b5e84fbdb..a9f7906c1a6a 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1400,7 +1400,7 @@ call_allocate(struct rpc_task *task) | |||
1400 | { | 1400 | { |
1401 | unsigned int slack = task->tk_rqstp->rq_cred->cr_auth->au_cslack; | 1401 | unsigned int slack = task->tk_rqstp->rq_cred->cr_auth->au_cslack; |
1402 | struct rpc_rqst *req = task->tk_rqstp; | 1402 | struct rpc_rqst *req = task->tk_rqstp; |
1403 | struct rpc_xprt *xprt = task->tk_xprt; | 1403 | struct rpc_xprt *xprt = req->rq_xprt; |
1404 | struct rpc_procinfo *proc = task->tk_msg.rpc_proc; | 1404 | struct rpc_procinfo *proc = task->tk_msg.rpc_proc; |
1405 | 1405 | ||
1406 | dprint_status(task); | 1406 | dprint_status(task); |
@@ -1508,7 +1508,7 @@ rpc_xdr_encode(struct rpc_task *task) | |||
1508 | static void | 1508 | static void |
1509 | call_bind(struct rpc_task *task) | 1509 | call_bind(struct rpc_task *task) |
1510 | { | 1510 | { |
1511 | struct rpc_xprt *xprt = task->tk_xprt; | 1511 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
1512 | 1512 | ||
1513 | dprint_status(task); | 1513 | dprint_status(task); |
1514 | 1514 | ||
@@ -1602,7 +1602,7 @@ retry_timeout: | |||
1602 | static void | 1602 | static void |
1603 | call_connect(struct rpc_task *task) | 1603 | call_connect(struct rpc_task *task) |
1604 | { | 1604 | { |
1605 | struct rpc_xprt *xprt = task->tk_xprt; | 1605 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
1606 | 1606 | ||
1607 | dprintk("RPC: %5u call_connect xprt %p %s connected\n", | 1607 | dprintk("RPC: %5u call_connect xprt %p %s connected\n", |
1608 | task->tk_pid, xprt, | 1608 | task->tk_pid, xprt, |
@@ -1685,7 +1685,7 @@ call_transmit(struct rpc_task *task) | |||
1685 | if (rpc_reply_expected(task)) | 1685 | if (rpc_reply_expected(task)) |
1686 | return; | 1686 | return; |
1687 | task->tk_action = rpc_exit_task; | 1687 | task->tk_action = rpc_exit_task; |
1688 | rpc_wake_up_queued_task(&task->tk_xprt->pending, task); | 1688 | rpc_wake_up_queued_task(&task->tk_rqstp->rq_xprt->pending, task); |
1689 | } | 1689 | } |
1690 | 1690 | ||
1691 | /* | 1691 | /* |
@@ -1784,7 +1784,7 @@ call_bc_transmit(struct rpc_task *task) | |||
1784 | */ | 1784 | */ |
1785 | printk(KERN_NOTICE "RPC: Could not send backchannel reply " | 1785 | printk(KERN_NOTICE "RPC: Could not send backchannel reply " |
1786 | "error: %d\n", task->tk_status); | 1786 | "error: %d\n", task->tk_status); |
1787 | xprt_conditional_disconnect(task->tk_xprt, | 1787 | xprt_conditional_disconnect(req->rq_xprt, |
1788 | req->rq_connect_cookie); | 1788 | req->rq_connect_cookie); |
1789 | break; | 1789 | break; |
1790 | default: | 1790 | default: |
@@ -1836,7 +1836,7 @@ call_status(struct rpc_task *task) | |||
1836 | case -ETIMEDOUT: | 1836 | case -ETIMEDOUT: |
1837 | task->tk_action = call_timeout; | 1837 | task->tk_action = call_timeout; |
1838 | if (task->tk_client->cl_discrtry) | 1838 | if (task->tk_client->cl_discrtry) |
1839 | xprt_conditional_disconnect(task->tk_xprt, | 1839 | xprt_conditional_disconnect(req->rq_xprt, |
1840 | req->rq_connect_cookie); | 1840 | req->rq_connect_cookie); |
1841 | break; | 1841 | break; |
1842 | case -ECONNRESET: | 1842 | case -ECONNRESET: |
@@ -1991,7 +1991,7 @@ out_retry: | |||
1991 | if (task->tk_rqstp == req) { | 1991 | if (task->tk_rqstp == req) { |
1992 | req->rq_reply_bytes_recvd = req->rq_rcv_buf.len = 0; | 1992 | req->rq_reply_bytes_recvd = req->rq_rcv_buf.len = 0; |
1993 | if (task->tk_client->cl_discrtry) | 1993 | if (task->tk_client->cl_discrtry) |
1994 | xprt_conditional_disconnect(task->tk_xprt, | 1994 | xprt_conditional_disconnect(req->rq_xprt, |
1995 | req->rq_connect_cookie); | 1995 | req->rq_connect_cookie); |
1996 | } | 1996 | } |
1997 | } | 1997 | } |
@@ -2005,7 +2005,7 @@ rpc_encode_header(struct rpc_task *task) | |||
2005 | 2005 | ||
2006 | /* FIXME: check buffer size? */ | 2006 | /* FIXME: check buffer size? */ |
2007 | 2007 | ||
2008 | p = xprt_skip_transport_header(task->tk_xprt, p); | 2008 | p = xprt_skip_transport_header(req->rq_xprt, p); |
2009 | *p++ = req->rq_xid; /* XID */ | 2009 | *p++ = req->rq_xid; /* XID */ |
2010 | *p++ = htonl(RPC_CALL); /* CALL */ | 2010 | *p++ = htonl(RPC_CALL); /* CALL */ |
2011 | *p++ = htonl(RPC_VERSION); /* RPC version */ | 2011 | *p++ = htonl(RPC_VERSION); /* RPC version */ |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 33811db8788a..846c34fdee9f 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -430,21 +430,23 @@ __xprt_put_cong(struct rpc_xprt *xprt, struct rpc_rqst *req) | |||
430 | */ | 430 | */ |
431 | void xprt_release_rqst_cong(struct rpc_task *task) | 431 | void xprt_release_rqst_cong(struct rpc_task *task) |
432 | { | 432 | { |
433 | __xprt_put_cong(task->tk_xprt, task->tk_rqstp); | 433 | struct rpc_rqst *req = task->tk_rqstp; |
434 | |||
435 | __xprt_put_cong(req->rq_xprt, req); | ||
434 | } | 436 | } |
435 | EXPORT_SYMBOL_GPL(xprt_release_rqst_cong); | 437 | EXPORT_SYMBOL_GPL(xprt_release_rqst_cong); |
436 | 438 | ||
437 | /** | 439 | /** |
438 | * xprt_adjust_cwnd - adjust transport congestion window | 440 | * xprt_adjust_cwnd - adjust transport congestion window |
441 | * @xprt: pointer to xprt | ||
439 | * @task: recently completed RPC request used to adjust window | 442 | * @task: recently completed RPC request used to adjust window |
440 | * @result: result code of completed RPC request | 443 | * @result: result code of completed RPC request |
441 | * | 444 | * |
442 | * We use a time-smoothed congestion estimator to avoid heavy oscillation. | 445 | * We use a time-smoothed congestion estimator to avoid heavy oscillation. |
443 | */ | 446 | */ |
444 | void xprt_adjust_cwnd(struct rpc_task *task, int result) | 447 | void xprt_adjust_cwnd(struct rpc_xprt *xprt, struct rpc_task *task, int result) |
445 | { | 448 | { |
446 | struct rpc_rqst *req = task->tk_rqstp; | 449 | struct rpc_rqst *req = task->tk_rqstp; |
447 | struct rpc_xprt *xprt = task->tk_xprt; | ||
448 | unsigned long cwnd = xprt->cwnd; | 450 | unsigned long cwnd = xprt->cwnd; |
449 | 451 | ||
450 | if (result >= 0 && cwnd <= xprt->cong) { | 452 | if (result >= 0 && cwnd <= xprt->cong) { |
@@ -695,7 +697,7 @@ out_abort: | |||
695 | */ | 697 | */ |
696 | void xprt_connect(struct rpc_task *task) | 698 | void xprt_connect(struct rpc_task *task) |
697 | { | 699 | { |
698 | struct rpc_xprt *xprt = task->tk_xprt; | 700 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
699 | 701 | ||
700 | dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, | 702 | dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, |
701 | xprt, (xprt_connected(xprt) ? "is" : "is not")); | 703 | xprt, (xprt_connected(xprt) ? "is" : "is not")); |
@@ -722,13 +724,13 @@ void xprt_connect(struct rpc_task *task) | |||
722 | if (xprt_test_and_set_connecting(xprt)) | 724 | if (xprt_test_and_set_connecting(xprt)) |
723 | return; | 725 | return; |
724 | xprt->stat.connect_start = jiffies; | 726 | xprt->stat.connect_start = jiffies; |
725 | xprt->ops->connect(task); | 727 | xprt->ops->connect(xprt, task); |
726 | } | 728 | } |
727 | } | 729 | } |
728 | 730 | ||
729 | static void xprt_connect_status(struct rpc_task *task) | 731 | static void xprt_connect_status(struct rpc_task *task) |
730 | { | 732 | { |
731 | struct rpc_xprt *xprt = task->tk_xprt; | 733 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
732 | 734 | ||
733 | if (task->tk_status == 0) { | 735 | if (task->tk_status == 0) { |
734 | xprt->stat.connect_count++; | 736 | xprt->stat.connect_count++; |
@@ -832,7 +834,7 @@ static void xprt_timer(struct rpc_task *task) | |||
832 | spin_lock_bh(&xprt->transport_lock); | 834 | spin_lock_bh(&xprt->transport_lock); |
833 | if (!req->rq_reply_bytes_recvd) { | 835 | if (!req->rq_reply_bytes_recvd) { |
834 | if (xprt->ops->timer) | 836 | if (xprt->ops->timer) |
835 | xprt->ops->timer(task); | 837 | xprt->ops->timer(xprt, task); |
836 | } else | 838 | } else |
837 | task->tk_status = 0; | 839 | task->tk_status = 0; |
838 | spin_unlock_bh(&xprt->transport_lock); | 840 | spin_unlock_bh(&xprt->transport_lock); |
@@ -1091,7 +1093,7 @@ EXPORT_SYMBOL_GPL(xprt_free); | |||
1091 | */ | 1093 | */ |
1092 | void xprt_reserve(struct rpc_task *task) | 1094 | void xprt_reserve(struct rpc_task *task) |
1093 | { | 1095 | { |
1094 | struct rpc_xprt *xprt = task->tk_xprt; | 1096 | struct rpc_xprt *xprt; |
1095 | 1097 | ||
1096 | task->tk_status = 0; | 1098 | task->tk_status = 0; |
1097 | if (task->tk_rqstp != NULL) | 1099 | if (task->tk_rqstp != NULL) |
@@ -1099,7 +1101,10 @@ void xprt_reserve(struct rpc_task *task) | |||
1099 | 1101 | ||
1100 | task->tk_timeout = 0; | 1102 | task->tk_timeout = 0; |
1101 | task->tk_status = -EAGAIN; | 1103 | task->tk_status = -EAGAIN; |
1104 | rcu_read_lock(); | ||
1105 | xprt = rcu_dereference(task->tk_client->cl_xprt); | ||
1102 | xprt->ops->alloc_slot(xprt, task); | 1106 | xprt->ops->alloc_slot(xprt, task); |
1107 | rcu_read_unlock(); | ||
1103 | } | 1108 | } |
1104 | 1109 | ||
1105 | static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt) | 1110 | static inline __be32 xprt_alloc_xid(struct rpc_xprt *xprt) |
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 558fbab574f0..e03725bfe2b8 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | |||
@@ -171,7 +171,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target, | |||
171 | struct rpcrdma_msg *headerp, enum rpcrdma_chunktype type) | 171 | struct rpcrdma_msg *headerp, enum rpcrdma_chunktype type) |
172 | { | 172 | { |
173 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 173 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
174 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_task->tk_xprt); | 174 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(rqst->rq_xprt); |
175 | int nsegs, nchunks = 0; | 175 | int nsegs, nchunks = 0; |
176 | unsigned int pos; | 176 | unsigned int pos; |
177 | struct rpcrdma_mr_seg *seg = req->rl_segments; | 177 | struct rpcrdma_mr_seg *seg = req->rl_segments; |
@@ -366,7 +366,7 @@ rpcrdma_inline_pullup(struct rpc_rqst *rqst, int pad) | |||
366 | int | 366 | int |
367 | rpcrdma_marshal_req(struct rpc_rqst *rqst) | 367 | rpcrdma_marshal_req(struct rpc_rqst *rqst) |
368 | { | 368 | { |
369 | struct rpc_xprt *xprt = rqst->rq_task->tk_xprt; | 369 | struct rpc_xprt *xprt = rqst->rq_xprt; |
370 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 370 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
371 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 371 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
372 | char *base; | 372 | char *base; |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index c9aa7a35f3bf..d0074289708e 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -426,9 +426,8 @@ xprt_rdma_set_port(struct rpc_xprt *xprt, u16 port) | |||
426 | } | 426 | } |
427 | 427 | ||
428 | static void | 428 | static void |
429 | xprt_rdma_connect(struct rpc_task *task) | 429 | xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task) |
430 | { | 430 | { |
431 | struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt; | ||
432 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 431 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
433 | 432 | ||
434 | if (r_xprt->rx_ep.rep_connected != 0) { | 433 | if (r_xprt->rx_ep.rep_connected != 0) { |
@@ -475,7 +474,7 @@ xprt_rdma_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) | |||
475 | static void * | 474 | static void * |
476 | xprt_rdma_allocate(struct rpc_task *task, size_t size) | 475 | xprt_rdma_allocate(struct rpc_task *task, size_t size) |
477 | { | 476 | { |
478 | struct rpc_xprt *xprt = task->tk_xprt; | 477 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
479 | struct rpcrdma_req *req, *nreq; | 478 | struct rpcrdma_req *req, *nreq; |
480 | 479 | ||
481 | req = rpcrdma_buffer_get(&rpcx_to_rdmax(xprt)->rx_buf); | 480 | req = rpcrdma_buffer_get(&rpcx_to_rdmax(xprt)->rx_buf); |
@@ -627,7 +626,7 @@ static int | |||
627 | xprt_rdma_send_request(struct rpc_task *task) | 626 | xprt_rdma_send_request(struct rpc_task *task) |
628 | { | 627 | { |
629 | struct rpc_rqst *rqst = task->tk_rqstp; | 628 | struct rpc_rqst *rqst = task->tk_rqstp; |
630 | struct rpc_xprt *xprt = task->tk_xprt; | 629 | struct rpc_xprt *xprt = rqst->rq_xprt; |
631 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); | 630 | struct rpcrdma_req *req = rpcr_to_rdmar(rqst); |
632 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 631 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
633 | 632 | ||
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 9a66c95b5837..cc1445dc1d1a 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h | |||
@@ -235,13 +235,13 @@ struct rpcrdma_create_data_internal { | |||
235 | }; | 235 | }; |
236 | 236 | ||
237 | #define RPCRDMA_INLINE_READ_THRESHOLD(rq) \ | 237 | #define RPCRDMA_INLINE_READ_THRESHOLD(rq) \ |
238 | (rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_rsize) | 238 | (rpcx_to_rdmad(rq->rq_xprt).inline_rsize) |
239 | 239 | ||
240 | #define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\ | 240 | #define RPCRDMA_INLINE_WRITE_THRESHOLD(rq)\ |
241 | (rpcx_to_rdmad(rq->rq_task->tk_xprt).inline_wsize) | 241 | (rpcx_to_rdmad(rq->rq_xprt).inline_wsize) |
242 | 242 | ||
243 | #define RPCRDMA_INLINE_PAD_VALUE(rq)\ | 243 | #define RPCRDMA_INLINE_PAD_VALUE(rq)\ |
244 | rpcx_to_rdmad(rq->rq_task->tk_xprt).padding | 244 | rpcx_to_rdmad(rq->rq_xprt).padding |
245 | 245 | ||
246 | /* | 246 | /* |
247 | * Statistics for RPCRDMA | 247 | * Statistics for RPCRDMA |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 68b0a81c31d5..37cbda63f45c 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -770,7 +770,7 @@ static void xs_tcp_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task) | |||
770 | goto out_release; | 770 | goto out_release; |
771 | if (req->rq_bytes_sent == req->rq_snd_buf.len) | 771 | if (req->rq_bytes_sent == req->rq_snd_buf.len) |
772 | goto out_release; | 772 | goto out_release; |
773 | set_bit(XPRT_CLOSE_WAIT, &task->tk_xprt->state); | 773 | set_bit(XPRT_CLOSE_WAIT, &xprt->state); |
774 | out_release: | 774 | out_release: |
775 | xprt_release_xprt(xprt, task); | 775 | xprt_release_xprt(xprt, task); |
776 | } | 776 | } |
@@ -1005,7 +1005,7 @@ static void xs_udp_data_ready(struct sock *sk, int len) | |||
1005 | 1005 | ||
1006 | UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); | 1006 | UDPX_INC_STATS_BH(sk, UDP_MIB_INDATAGRAMS); |
1007 | 1007 | ||
1008 | xprt_adjust_cwnd(task, copied); | 1008 | xprt_adjust_cwnd(xprt, task, copied); |
1009 | xprt_complete_rqst(task, copied); | 1009 | xprt_complete_rqst(task, copied); |
1010 | 1010 | ||
1011 | out_unlock: | 1011 | out_unlock: |
@@ -1646,9 +1646,9 @@ static void xs_udp_set_buffer_size(struct rpc_xprt *xprt, size_t sndsize, size_t | |||
1646 | * | 1646 | * |
1647 | * Adjust the congestion window after a retransmit timeout has occurred. | 1647 | * Adjust the congestion window after a retransmit timeout has occurred. |
1648 | */ | 1648 | */ |
1649 | static void xs_udp_timer(struct rpc_task *task) | 1649 | static void xs_udp_timer(struct rpc_xprt *xprt, struct rpc_task *task) |
1650 | { | 1650 | { |
1651 | xprt_adjust_cwnd(task, -ETIMEDOUT); | 1651 | xprt_adjust_cwnd(xprt, task, -ETIMEDOUT); |
1652 | } | 1652 | } |
1653 | 1653 | ||
1654 | static unsigned short xs_get_random_port(void) | 1654 | static unsigned short xs_get_random_port(void) |
@@ -1731,7 +1731,9 @@ static int xs_bind(struct sock_xprt *transport, struct socket *sock) | |||
1731 | */ | 1731 | */ |
1732 | static void xs_local_rpcbind(struct rpc_task *task) | 1732 | static void xs_local_rpcbind(struct rpc_task *task) |
1733 | { | 1733 | { |
1734 | xprt_set_bound(task->tk_xprt); | 1734 | rcu_read_lock(); |
1735 | xprt_set_bound(rcu_dereference(task->tk_client->cl_xprt)); | ||
1736 | rcu_read_unlock(); | ||
1735 | } | 1737 | } |
1736 | 1738 | ||
1737 | static void xs_local_set_port(struct rpc_xprt *xprt, unsigned short port) | 1739 | static void xs_local_set_port(struct rpc_xprt *xprt, unsigned short port) |
@@ -2205,6 +2207,7 @@ out: | |||
2205 | 2207 | ||
2206 | /** | 2208 | /** |
2207 | * xs_connect - connect a socket to a remote endpoint | 2209 | * xs_connect - connect a socket to a remote endpoint |
2210 | * @xprt: pointer to transport structure | ||
2208 | * @task: address of RPC task that manages state of connect request | 2211 | * @task: address of RPC task that manages state of connect request |
2209 | * | 2212 | * |
2210 | * TCP: If the remote end dropped the connection, delay reconnecting. | 2213 | * TCP: If the remote end dropped the connection, delay reconnecting. |
@@ -2216,9 +2219,8 @@ out: | |||
2216 | * If a UDP socket connect fails, the delay behavior here prevents | 2219 | * If a UDP socket connect fails, the delay behavior here prevents |
2217 | * retry floods (hard mounts). | 2220 | * retry floods (hard mounts). |
2218 | */ | 2221 | */ |
2219 | static void xs_connect(struct rpc_task *task) | 2222 | static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task) |
2220 | { | 2223 | { |
2221 | struct rpc_xprt *xprt = task->tk_xprt; | ||
2222 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 2224 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
2223 | 2225 | ||
2224 | if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { | 2226 | if (transport->sock != NULL && !RPC_IS_SOFTCONN(task)) { |