Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: samba-bugs@samba.org
To: cifs-qa@samba.org
Subject: [Bug 15136] Access to cifs gets stuck for a while (>20s) after disconnecting from network
Date: Thu, 04 Aug 2022 14:05:05 +0000	[thread overview]
Message-ID: <bug-15136-10630-9L4VY2cCTu@https.bugzilla.samba.org/> (raw)
In-Reply-To: <bug-15136-10630@https.bugzilla.samba.org/>

https://bugzilla.samba.org/show_bug.cgi?id=15136

--- Comment #1 from Enzo Matsumiya <ematsumiya@suse.de> ---
Hi, thanks for the patch. This is also a problem I've been trying to solve, but
haven't came up with a good solution so far.

You set SMB_WAIT_RECONNECT_TIMEOUT_MIN to 0, but that would conflict with the
socket timeout which is 7 seconds. This is also stated above the loop in
smb2pdu.c:

> ...
>  189         /*
>  190          * Give demultiplex thread up to 10 seconds to each target available for
>  191          * reconnect -- should be greater than cifs socket timeout which is 7
>  192          * seconds.
>  193          */
>  194         while (server->tcpStatus == CifsNeedReconnect) {
> ...

Those 7 seconds are also hardcoded (connect.c):

> 2951         /*
> 2952          * Eventually check for other socket options to change from
> 2953          * the default. sock_setsockopt not used because it expects
> 2954          * user space buffer
> 2955          */
> 2956         socket->sk->sk_rcvtimeo = 7 * HZ;

(bear in mind that this value predates the 2.6 kernel, IOW I don't know the
reasoning to choosing such value)

Maybe we could reduce the hardcoded values and/or apply such mount option to
the socket instead, and, then, base the reconnect on sk_rcvtimeo? Just an idea.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

  reply	other threads:[~2022-08-04 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  3:01 [Bug 15136] New: Access to cifs gets stuck for a while (>20s) after disconnecting from network samba-bugs
2022-08-04 14:05 ` samba-bugs [this message]
2022-08-05  3:14 ` [Bug 15136] " samba-bugs

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=bug-15136-10630-9L4VY2cCTu@https.bugzilla.samba.org/ \
    --to=samba-bugs@samba.org \
    --cc=cifs-qa@samba.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