From: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v1 4/7] sunrpc: Allow xprt->ops->timer method to sleep
Date: Thu, 26 Jan 2017 12:56:03 -0500 [thread overview]
Message-ID: <20170126175603.5794.40191.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20170126174806.5794.14678.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
The transport lock is needed to protect the xprt_adjust_cwnd() call
in xs_udp_timer, but it is not necessary for accessing the
rq_reply_bytes_recvd or tk_status fields.
Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
net/sunrpc/xprt.c | 2 --
net/sunrpc/xprtsock.c | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 9a6be03..b530a28 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -897,13 +897,11 @@ static void xprt_timer(struct rpc_task *task)
return;
dprintk("RPC: %5u xprt_timer\n", task->tk_pid);
- spin_lock_bh(&xprt->transport_lock);
if (!req->rq_reply_bytes_recvd) {
if (xprt->ops->timer)
xprt->ops->timer(xprt, task);
} else
task->tk_status = 0;
- spin_unlock_bh(&xprt->transport_lock);
}
/**
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index af392d9..d9bb644 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1734,7 +1734,9 @@ static void xs_udp_set_buffer_size(struct rpc_xprt *xprt, size_t sndsize, size_t
*/
static void xs_udp_timer(struct rpc_xprt *xprt, struct rpc_task *task)
{
+ spin_lock_bh(&xprt->transport_lock);
xprt_adjust_cwnd(xprt, task, -ETIMEDOUT);
+ spin_unlock_bh(&xprt->transport_lock);
}
static unsigned short xs_get_random_port(void)
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-01-26 17:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-26 17:55 [PATCH v1 0/7] NFS/RDMA client-side patches for 4.11 Chuck Lever
[not found] ` <20170126174806.5794.14678.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-01-26 17:55 ` [PATCH v1 1/7] xprtrdma: Properly recover FRWRs with in-flight FASTREG WRs Chuck Lever
2017-01-26 17:55 ` [PATCH v1 2/7] xprtrdma: Handle stale connection rejection Chuck Lever
2017-01-26 17:55 ` [PATCH v1 3/7] xprtrdma: Refactor management of mw_list field Chuck Lever
2017-01-26 17:56 ` Chuck Lever [this message]
2017-01-26 17:56 ` [PATCH v1 5/7] sunrpc: Enable calls to rpc_call_null_helper() from other modules Chuck Lever
[not found] ` <20170126175611.5794.20844.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-01-27 22:07 ` Anna Schumaker
[not found] ` <edab4aee-158d-0d5d-6ef2-9a44e63a929c-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-27 22:10 ` Chuck Lever
2017-01-26 17:56 ` [PATCH v1 6/7] xprtrdma: Detect unreachable NFS/RDMA servers more reliably Chuck Lever
2017-01-26 17:56 ` [PATCH v1 7/7] sunrpc: Allow keepalive ping on a credit-full transport Chuck Lever
[not found] ` <20170126175628.5794.56813.stgit-FYjufvaPoItvLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-01-30 20:29 ` Anna Schumaker
[not found] ` <5268b237-2c33-2058-d4b2-798afe021243-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-30 20:32 ` Chuck Lever
[not found] ` <7694B03F-328F-472A-8A41-F3D6DCF0125E-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-01-30 21:36 ` Anna Schumaker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170126175603.5794.40191.stgit@manet.1015granger.net \
--to=chuck.lever-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
--cc=linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox