From: Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>
To: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 15/18] cifs: reconnect unresponsive servers
Date: Thu, 23 Dec 2010 16:01:08 +0530 [thread overview]
Message-ID: <4D1324EC.8010305@suse.de> (raw)
In-Reply-To: <1292598497-29796-16-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 12/17/2010 08:38 PM, Jeff Layton wrote:
> If the server isn't responding to echoes, we don't want to leave tasks
> hung waiting for it to reply. At that point, we'll want to reconnect
> so that soft mounts can return an error to userspace quickly.
>
> If the client hasn't received a reply after 3 echo intervals, assume
> that the transport is down and attempt to reconnect the socket.
>
> Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> fs/cifs/connect.c | 23 +++++++++++++++++++----
> 1 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 20f6eda..2ad3c67 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -55,6 +55,9 @@
> /* SMB echo "timeout" -- FIXME: tunable? */
> #define SMB_ECHO_INTERVAL (60 * HZ)
>
> +/* reconnect if no response from server in this time period */
> +#define UNRESPONSIVE_SERVER_TIMEOUT (5 * SMB_ECHO_INTERVAL)
> +
It's not clear to me why is this timeout is set to be
5 * SMB_ECHO_INTERVAL?
> extern void SMBNTencrypt(unsigned char *passwd, unsigned char *c8,
> unsigned char *p24);
>
> @@ -186,6 +189,7 @@ cifs_reconnect(struct TCP_Server_Info *server)
> kfree(server->session_key.response);
> server->session_key.response = NULL;
> server->session_key.len = 0;
> + server->lstrp = jiffies;
> mutex_unlock(&server->srv_mutex);
>
> /*
> @@ -423,7 +427,19 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server)
> smb_msg.msg_control = NULL;
> smb_msg.msg_controllen = 0;
> pdu_length = 4; /* enough to get RFC1001 header */
> +
> incomplete_rcv:
> + if (time_after(jiffies,
> + server->lstrp + UNRESPONSIVE_SERVER_TIMEOUT)) {
> + cERROR(1, "Server %s has not responded in %d seconds. "
> + "Reconnecting...", server->hostname,
> + UNRESPONSIVE_SERVER_TIMEOUT / HZ);
> + cifs_reconnect(server);
> + csocket = server->ssocket;
> + wake_up(&server->response_q);
> + continue;
> + }
> +
> length =
> kernel_recvmsg(csocket, &smb_msg,
> &iov, 1, pdu_length, 0 /* BB other flags? */);
> @@ -584,6 +600,8 @@ incomplete_rcv:
> }
>
> mid_entry = NULL;
> + server->lstrp = jiffies;
> +
> spin_lock(&GlobalMid_Lock);
> list_for_each_safe(tmp, tmp2, &server->pending_mid_q) {
> mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
> @@ -632,10 +650,6 @@ multi_t2_fnd:
> #ifdef CONFIG_CIFS_STATS2
> mid_entry->when_received = jiffies;
> #endif
> - /* so we do not time out requests to server
> - which is still responding (since server could
> - be busy but not dead) */
> - server->lstrp = jiffies;
> break;
> }
> mid_entry = NULL;
> @@ -1685,6 +1699,7 @@ cifs_get_tcp_session(struct smb_vol *volume_info)
> volume_info->target_rfc1001_name, RFC1001_NAME_LEN_WITH_NULL);
> tcp_ses->session_estab = false;
> tcp_ses->sequence_number = 0;
> + tcp_ses->lstrp = jiffies;
> INIT_LIST_HEAD(&tcp_ses->tcp_ses_list);
> INIT_LIST_HEAD(&tcp_ses->smb_ses_list);
> INIT_DELAYED_WORK(&tcp_ses->echo, cifs_echo_request);
--
Suresh Jayaraman
next prev parent reply other threads:[~2010-12-23 10:31 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-17 15:07 [PATCH 00/18] cifs: overhaul request timeout behavior in CIFS (try #3) Jeff Layton
[not found] ` <1292598497-29796-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-17 15:08 ` [PATCH 01/18] cifs: don't fail writepages on -EAGAIN errors Jeff Layton
[not found] ` <1292598497-29796-2-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 10:53 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 02/18] cifs: no need to mark smb_ses_list as cifs_demultiplex_thread is exiting Jeff Layton
[not found] ` <1292598497-29796-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 10:52 ` Suresh Jayaraman
2010-12-20 16:38 ` Suresh Jayaraman
[not found] ` <4D0F868E.8020407-l3A5Bk7waGM@public.gmane.org>
2010-12-21 1:38 ` Jeff Layton
2010-12-17 15:08 ` [PATCH 03/18] cifs: make wait_for_free_request take a TCP_Server_Info pointer Jeff Layton
[not found] ` <1292598497-29796-4-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 10:52 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 04/18] cifs: clean up accesses to midCount Jeff Layton
[not found] ` <1292598497-29796-5-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 10:52 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 05/18] cifs: move locked sections out of DeleteMidQEntry and AllocMidQEntry Jeff Layton
[not found] ` <1292598497-29796-6-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 11:00 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 06/18] cifs: move mid result processing into common function Jeff Layton
[not found] ` <1292598497-29796-7-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 11:06 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 07/18] cifs: wait indefinitely for responses Jeff Layton
[not found] ` <1292598497-29796-8-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-21 15:50 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 08/18] cifs: don't reconnect server when we don't get a response Jeff Layton
[not found] ` <1292598497-29796-9-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 11:27 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 09/18] cifs: clean up sync_mid_result Jeff Layton
[not found] ` <1292598497-29796-10-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-20 11:27 ` Suresh Jayaraman
[not found] ` <4D0F3DAD.7080801-l3A5Bk7waGM@public.gmane.org>
2010-12-20 13:04 ` Jeff Layton
[not found] ` <20101220080409.35112ed8-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-12-20 16:35 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 10/18] cifs: allow for different handling of received response Jeff Layton
[not found] ` <1292598497-29796-11-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-21 15:50 ` Suresh Jayaraman
[not found] ` <4D10CCD3.1040502-l3A5Bk7waGM@public.gmane.org>
2010-12-21 16:48 ` Jeff Layton
2010-12-21 15:51 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 11/18] cifs: handle cancelled requests better Jeff Layton
2010-12-17 15:08 ` [PATCH 12/18] cifs: add cifs_call_async Jeff Layton
[not found] ` <1292598497-29796-13-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-21 16:05 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 13/18] cifs: add ability to send an echo request Jeff Layton
[not found] ` <1292598497-29796-14-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-21 16:05 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 14/18] cifs: set up recurring workqueue job to do SMB echo requests Jeff Layton
[not found] ` <1292598497-29796-15-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-21 16:06 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 15/18] cifs: reconnect unresponsive servers Jeff Layton
[not found] ` <1292598497-29796-16-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-23 10:31 ` Suresh Jayaraman [this message]
[not found] ` <4D1324EC.8010305-l3A5Bk7waGM@public.gmane.org>
2010-12-23 13:20 ` Jeff Layton
[not found] ` <20101223082005.347b8ca8-xSBYVWDuneFaJnirhKH9O4GKTjYczspe@public.gmane.org>
2010-12-23 15:36 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 16/18] cifs: remove code for setting timeouts on requests Jeff Layton
[not found] ` <1292598497-29796-17-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-23 10:32 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 17/18] cifs: mangle existing header for SMB_COM_NT_CANCEL Jeff Layton
[not found] ` <1292598497-29796-18-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-23 11:05 ` Suresh Jayaraman
2010-12-17 15:08 ` [PATCH 18/18] cifs: send an NT_CANCEL request when a process is signalled Jeff Layton
[not found] ` <1292598497-29796-19-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-23 11:06 ` Suresh Jayaraman
-- strict thread matches above, loose matches on Subject: below --
2010-12-27 2:29 [PATCH 00/18] cifs: overhaul request timeout behavior in CIFS (try #4) Jeff Layton
[not found] ` <1293417006-6417-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-27 2:30 ` [PATCH 15/18] cifs: reconnect unresponsive servers Jeff Layton
[not found] ` <1293417006-6417-16-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-12-27 15:58 ` Pavel Shilovsky
2011-01-06 7:16 ` Suresh Jayaraman
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=4D1324EC.8010305@suse.de \
--to=sjayaraman-l3a5bk7wagm@public.gmane.org \
--cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@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