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
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html