From: Valentin Hilbig <externer.dl.hilbig-EnyPcy3oyxIb1SvskN2V4Q@public.gmane.org>
To: Sachin Prabhu <sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: Linux CIFS client module: login rate limiting
Date: Fri, 28 Apr 2017 18:34:17 +0200 [thread overview]
Message-ID: <59036F09.7080403@muenchen.de> (raw)
In-Reply-To: <1485251879.17488.14.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 2017-01-24 at 10:57, Sachin Prabhu wrote:
> On Mon, 2017-01-23 at 16:27 +0530, Sachin Prabhu wrote:
>> On Fri, 2017-01-20 at 15:30 -0600, Steve French wrote:
>> cifs_reconnect_tcon()
>> {
>> ..
>> mutex_lock(&ses->session_mutex);
>> rc = cifs_negotiate_protocol(0, ses);
>> if (rc == 0 && ses->need_reconnect)
>> rc = cifs_setup_session(0, ses, nls_codepage);
>> ..
>> }
>> Where in case of EACCES, we can setup a delayed work to unlock ses-
>>> session_mutex set to run after the required interval.
> Attached is a patch which can work in this case. I use a cache interval
> of 10 seconds which can be extended further.
It took a while until I found time to test your suggested patch.
Sorry for the delay. Please note that your patch needs a small patch:
In cifsglob.h (around line 835) the
+ bool cached_rc;
should read
+ int cached_rc;
as it holds the rc, not a flag.
Then it works as expected! As soon as the reconnect fails due to
password trouble, CIFS pauses 10s until the next retry. Wonderful. ;)
So thank you very much for pointing me into the right direction!
As soon as everything is finished here I will report back to this list
to give you the link to GitHub where I pushed my patches against Ubuntu
3.13 and 4.4 kernels.
CU
-Tino
next prev parent reply other threads:[~2017-04-28 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 7:48 Linux CIFS client module: login rate limiting Valentin Hilbig
[not found] ` <58806F39.9010801-EnyPcy3oyxIb1SvskN2V4Q@public.gmane.org>
2017-01-20 21:30 ` Steve French
[not found] ` <CAH2r5mtrOqucTBXE3Ni02gWGVBG+o-EbgdVarL1xZjWv0S2xyQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-23 10:57 ` Sachin Prabhu
[not found] ` <1485169046.17488.5.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-01-24 9:57 ` Sachin Prabhu
[not found] ` <1485251879.17488.14.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-04-28 16:34 ` Valentin Hilbig [this message]
2017-01-23 12:13 ` Valentin Hilbig
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=59036F09.7080403@muenchen.de \
--to=externer.dl.hilbig-enypcy3oyxib1svskn2v4q@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sprabhu-H+wXaHxf7aLQT0dZR+AlfA@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.