Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.9-stable tree
This is a note to let you know that I've just added the patch titled
CIFS: reconnect thread reschedule itself
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
cifs-reconnect-thread-reschedule-itself.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
18ea43113f5b74a97dd4be9bddbac10d68b1a6ceMon Sep 17 00:00:00 2001
From: Germano Percossi <[email protected]>
Date: Fri, 7 Apr 2017 12:29:36 +0100
Subject: CIFS: reconnect thread reschedule itself
From: Germano Percossi <[email protected]>
commit 18ea43113f5b74a97dd4be9bddbac10d68b1a6ce upstream.
In case of error, smb2_reconnect_server reschedule itself with a delay, to avoid being too aggressive.
--- fs/cifs/smb2pdu.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
fs/cifs/smb2pdu.c +9 -1
@@ -1987,6 +1987,9 @@ void smb2_reconnect_server(struct work_sstruct cifs_tcon *tcon, *tcon2;struct list_head tmp_list;int tcon_exist = false; +int rc; +int resched = false; +/* Prevent simultaneous reconnects that can corrupt tcon->rlist list */ mutex_lock (&server->reconnect_mutex);
@@ -2014,13 +2017,18 @@ void smb2_reconnect_server(struct work_sspin_unlock (&cifs_tcp_ses_lock);list_for_each_entry_safe (tcon, tcon2, &tmp_list, rlist) { -if (!smb2_reconnect (SMB2_INTERNAL_CMD , tcon)) + rc =smb2_reconnect (SMB2_INTERNAL_CMD , tcon); +if (!rc)cifs_reopen_persistent_handles (tcon); +else + resched = true;list_del_init (&tcon->rlist);cifs_put_tcon (tcon); }cifs_dbg (FYI ,"Reconnecting tcons finished\n" ); +if (resched) +queue_delayed_work (cifsiod_wq, &server->reconnect,2 *HZ );mutex_unlock (&server->reconnect_mutex);/* now we can safely release srv struct */
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/cifs-reconnect-thread-reschedule-itself.patch queue-4.9/cifs-store-results-of-cifs_reopen_file-to-avoid-infinite-wait.patch