All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
@ 2017-04-18 12:48 gregkh
  2017-04-20 10:07 ` Germano Percossi
  0 siblings, 1 reply; 9+ messages in thread
From: gregkh @ 2017-04-18 12:48 UTC (permalink / raw)
  To: germano.percossi, gregkh, pshilov, smfrench; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    CIFS: reconnect thread reschedule itself

to the 4.10-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.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 18ea43113f5b74a97dd4be9bddbac10d68b1a6ce Mon Sep 17 00:00:00 2001
From: Germano Percossi <germano.percossi@citrix.com>
Date: Fri, 7 Apr 2017 12:29:36 +0100
Subject: CIFS: reconnect thread reschedule itself

From: Germano Percossi <germano.percossi@citrix.com>

commit 18ea43113f5b74a97dd4be9bddbac10d68b1a6ce upstream.

In case of error, smb2_reconnect_server reschedule itself
with a delay, to avoid being too aggressive.

Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/cifs/smb2pdu.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1987,6 +1987,9 @@ void smb2_reconnect_server(struct work_s
 	struct 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_s
 	spin_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 germano.percossi@citrix.com are

queue-4.10/cifs-reconnect-thread-reschedule-itself.patch
queue-4.10/cifs-store-results-of-cifs_reopen_file-to-avoid-infinite-wait.patch

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-18 12:48 Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree gregkh
@ 2017-04-20 10:07 ` Germano Percossi
  2017-04-20 11:05   ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Germano Percossi @ 2017-04-20 10:07 UTC (permalink / raw)
  To: gregkh; +Cc: pshilov, smfrench, stable, stable-commits

Hi Greg,

With respect to the 3 patches I received notifications about,
I noticed the following:

a0918f1ce6 "CIFS: remove bad_network_name flag": you tried to apply it
     on 4.10, 4.9 and 4.4 but it failed. I sent the fixed backport.
1fa839b498 "CIFS: store results of cifs_reopen_file..": it has been
     put in the queue for 3.18, 4.4, 4.9 and 4.10
18ea43113f "CIFS: reconnect thread reschedule itself": it has been
     put in the queue for 4.9 and 4.10

Is there any reason why 1fa839b498 goes into 4 stable releases, while
the others in in, respectively, 3 and 2 releases?

Kind Regards,
Germano


On 18/04/17 13:48, gregkh@linuxfoundation.org wrote:
>
> This is a note to let you know that I've just added the patch titled
>
>     CIFS: reconnect thread reschedule itself
>
> to the 4.10-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.10 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable@vger.kernel.org> know about it.
>
>
> From 18ea43113f5b74a97dd4be9bddbac10d68b1a6ce Mon Sep 17 00:00:00 2001
> From: Germano Percossi <germano.percossi@citrix.com>
> Date: Fri, 7 Apr 2017 12:29:36 +0100
> Subject: CIFS: reconnect thread reschedule itself
>
> From: Germano Percossi <germano.percossi@citrix.com>
>
> commit 18ea43113f5b74a97dd4be9bddbac10d68b1a6ce upstream.
>
> In case of error, smb2_reconnect_server reschedule itself
> with a delay, to avoid being too aggressive.
>
> Signed-off-by: Germano Percossi <germano.percossi@citrix.com>
> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
> Signed-off-by: Steve French <smfrench@gmail.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
>  fs/cifs/smb2pdu.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1987,6 +1987,9 @@ void smb2_reconnect_server(struct work_s
>  	struct 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_s
>  	spin_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 germano.percossi@citrix.com are
>
> queue-4.10/cifs-reconnect-thread-reschedule-itself.patch
> queue-4.10/cifs-store-results-of-cifs_reopen_file-to-avoid-infinite-wait.patch
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 10:07 ` Germano Percossi
@ 2017-04-20 11:05   ` Greg KH
  2017-04-20 11:10     ` Germano Percossi
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2017-04-20 11:05 UTC (permalink / raw)
  To: Germano Percossi; +Cc: pshilov, smfrench, stable, stable-commits

On Thu, Apr 20, 2017 at 11:07:52AM +0100, Germano Percossi wrote:
> Hi Greg,
> 
> With respect to the 3 patches I received notifications about,
> I noticed the following:
> 
> a0918f1ce6 "CIFS: remove bad_network_name flag": you tried to apply it
>     on 4.10, 4.9 and 4.4 but it failed. I sent the fixed backport.
> 1fa839b498 "CIFS: store results of cifs_reopen_file..": it has been
>     put in the queue for 3.18, 4.4, 4.9 and 4.10
> 18ea43113f "CIFS: reconnect thread reschedule itself": it has been
>     put in the queue for 4.9 and 4.10
> 
> Is there any reason why 1fa839b498 goes into 4 stable releases, while
> the others in in, respectively, 3 and 2 releases?

Perhaps they do not apply to those trees?  That's the reason I wouldn't
add them there.  If you think they do belong there, I would be glad to
accept a backported version of the patches.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 11:05   ` Greg KH
@ 2017-04-20 11:10     ` Germano Percossi
  2017-04-20 11:44       ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Germano Percossi @ 2017-04-20 11:10 UTC (permalink / raw)
  To: Greg KH; +Cc: pshilov, smfrench, stable, stable-commits

The reason why I asked it's because I did not receive any
"Failed" notification, so I assumed you did not even try.

I sent the backport for a0918f1ce6 because I was notified of the failure.

I'll send a backport for all the remaining patches (wherever
it makes sense).

Germano

On 20/04/17 12:05, Greg KH wrote:
> On Thu, Apr 20, 2017 at 11:07:52AM +0100, Germano Percossi wrote:
>> Hi Greg,
>>
>> With respect to the 3 patches I received notifications about,
>> I noticed the following:
>>
>> a0918f1ce6 "CIFS: remove bad_network_name flag": you tried to apply it
>>     on 4.10, 4.9 and 4.4 but it failed. I sent the fixed backport.
>> 1fa839b498 "CIFS: store results of cifs_reopen_file..": it has been
>>     put in the queue for 3.18, 4.4, 4.9 and 4.10
>> 18ea43113f "CIFS: reconnect thread reschedule itself": it has been
>>     put in the queue for 4.9 and 4.10
>>
>> Is there any reason why 1fa839b498 goes into 4 stable releases, while
>> the others in in, respectively, 3 and 2 releases?
>
> Perhaps they do not apply to those trees?  That's the reason I wouldn't
> add them there.  If you think they do belong there, I would be glad to
> accept a backported version of the patches.
>
> thanks,
>
> greg k-h
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 11:10     ` Germano Percossi
@ 2017-04-20 11:44       ` Greg KH
  2017-04-20 13:07         ` Germano Percossi
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2017-04-20 11:44 UTC (permalink / raw)
  To: Germano Percossi; +Cc: pshilov, smfrench, stable, stable-commits

On Thu, Apr 20, 2017 at 12:10:00PM +0100, Germano Percossi wrote:
> The reason why I asked it's because I did not receive any
> "Failed" notification, so I assumed you did not even try.

I tried, but for patches without any specific "Fixes:" tag, I have to
just guess that if the patch does not apply, then it was not wanted
to go that far back.

> I sent the backport for a0918f1ce6 because I was notified of the failure.
> 
> I'll send a backport for all the remaining patches (wherever
> it makes sense).

thanks for that.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 11:44       ` Greg KH
@ 2017-04-20 13:07         ` Germano Percossi
  2017-04-20 13:34           ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Germano Percossi @ 2017-04-20 13:07 UTC (permalink / raw)
  To: Greg KH; +Cc: pshilov, smfrench, stable, stable-commits

Hi,

On 20/04/17 12:44, Greg KH wrote:
> On Thu, Apr 20, 2017 at 12:10:00PM +0100, Germano Percossi wrote:
>> The reason why I asked it's because I did not receive any
>> "Failed" notification, so I assumed you did not even try.
>
> I tried, but for patches without any specific "Fixes:" tag, I have to
> just guess that if the patch does not apply, then it was not wanted
> to go that far back.
>

You were right in your assumption about 18ea43113f: it could be ported
but it is not so important for 3.18 and 4.4 because we are not using
persistent handles there.

For what concerns a0918f1ce6 "remove bad network.." on 3.18 I just ran
git cherry-pick a0918f1ce6
on stable/linux-3.18.y without any problem.
Unless you use other commands with fuzz level lower than 2
it should apply as is.

KR,

Germano

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 13:07         ` Germano Percossi
@ 2017-04-20 13:34           ` Greg KH
  2017-04-21  8:37             ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2017-04-20 13:34 UTC (permalink / raw)
  To: Germano Percossi; +Cc: pshilov, smfrench, stable, stable-commits

On Thu, Apr 20, 2017 at 02:07:47PM +0100, Germano Percossi wrote:
> Hi,
> 
> On 20/04/17 12:44, Greg KH wrote:
> > On Thu, Apr 20, 2017 at 12:10:00PM +0100, Germano Percossi wrote:
> > > The reason why I asked it's because I did not receive any
> > > "Failed" notification, so I assumed you did not even try.
> > 
> > I tried, but for patches without any specific "Fixes:" tag, I have to
> > just guess that if the patch does not apply, then it was not wanted
> > to go that far back.
> > 
> 
> You were right in your assumption about 18ea43113f: it could be ported
> but it is not so important for 3.18 and 4.4 because we are not using
> persistent handles there.
> 
> For what concerns a0918f1ce6 "remove bad network.." on 3.18 I just ran
> git cherry-pick a0918f1ce6
> on stable/linux-3.18.y without any problem.
> Unless you use other commands with fuzz level lower than 2
> it should apply as is.

Odd, it does apply, thanks.  I'll apply it for the next 3.18-stable
release after the current -rc one is released in a few days.

thanks for researching this.

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-20 13:34           ` Greg KH
@ 2017-04-21  8:37             ` Greg KH
  2017-04-21  8:38               ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Greg KH @ 2017-04-21  8:37 UTC (permalink / raw)
  To: Germano Percossi; +Cc: pshilov, smfrench, stable, stable-commits

On Thu, Apr 20, 2017 at 03:34:19PM +0200, Greg KH wrote:
> On Thu, Apr 20, 2017 at 02:07:47PM +0100, Germano Percossi wrote:
> > Hi,
> > 
> > On 20/04/17 12:44, Greg KH wrote:
> > > On Thu, Apr 20, 2017 at 12:10:00PM +0100, Germano Percossi wrote:
> > > > The reason why I asked it's because I did not receive any
> > > > "Failed" notification, so I assumed you did not even try.
> > > 
> > > I tried, but for patches without any specific "Fixes:" tag, I have to
> > > just guess that if the patch does not apply, then it was not wanted
> > > to go that far back.
> > > 
> > 
> > You were right in your assumption about 18ea43113f: it could be ported
> > but it is not so important for 3.18 and 4.4 because we are not using
> > persistent handles there.
> > 
> > For what concerns a0918f1ce6 "remove bad network.." on 3.18 I just ran
> > git cherry-pick a0918f1ce6
> > on stable/linux-3.18.y without any problem.
> > Unless you use other commands with fuzz level lower than 2
> > it should apply as is.
> 
> Odd, it does apply, thanks.  I'll apply it for the next 3.18-stable
> release after the current -rc one is released in a few days.

Hm, but it isn't in 4.4-stable, you want it there too, right?  It
doesn't apply cleanly there:

Applying cifs-remove-bad_network_name-flag.patch to linux-4.4.y
Applying patch cifs-remove-bad_network_name-flag.patch
patching file fs/cifs/cifsglob.h
Hunk #1 succeeded at 906 (offset -42 lines).
patching file fs/cifs/smb2pdu.c
Hunk #1 FAILED at 1171.
Hunk #2 succeeded at 1036 with fuzz 2 (offset -241 lines).
1 out of 2 hunks FAILED -- rejects in file fs/cifs/smb2pdu.c

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree
  2017-04-21  8:37             ` Greg KH
@ 2017-04-21  8:38               ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2017-04-21  8:38 UTC (permalink / raw)
  To: Germano Percossi; +Cc: pshilov, smfrench, stable, stable-commits

On Fri, Apr 21, 2017 at 10:37:06AM +0200, Greg KH wrote:
> On Thu, Apr 20, 2017 at 03:34:19PM +0200, Greg KH wrote:
> > On Thu, Apr 20, 2017 at 02:07:47PM +0100, Germano Percossi wrote:
> > > Hi,
> > > 
> > > On 20/04/17 12:44, Greg KH wrote:
> > > > On Thu, Apr 20, 2017 at 12:10:00PM +0100, Germano Percossi wrote:
> > > > > The reason why I asked it's because I did not receive any
> > > > > "Failed" notification, so I assumed you did not even try.
> > > > 
> > > > I tried, but for patches without any specific "Fixes:" tag, I have to
> > > > just guess that if the patch does not apply, then it was not wanted
> > > > to go that far back.
> > > > 
> > > 
> > > You were right in your assumption about 18ea43113f: it could be ported
> > > but it is not so important for 3.18 and 4.4 because we are not using
> > > persistent handles there.
> > > 
> > > For what concerns a0918f1ce6 "remove bad network.." on 3.18 I just ran
> > > git cherry-pick a0918f1ce6
> > > on stable/linux-3.18.y without any problem.
> > > Unless you use other commands with fuzz level lower than 2
> > > it should apply as is.
> > 
> > Odd, it does apply, thanks.  I'll apply it for the next 3.18-stable
> > release after the current -rc one is released in a few days.
> 
> Hm, but it isn't in 4.4-stable, you want it there too, right?  It
> doesn't apply cleanly there:
> 
> Applying cifs-remove-bad_network_name-flag.patch to linux-4.4.y
> Applying patch cifs-remove-bad_network_name-flag.patch
> patching file fs/cifs/cifsglob.h
> Hunk #1 succeeded at 906 (offset -42 lines).
> patching file fs/cifs/smb2pdu.c
> Hunk #1 FAILED at 1171.
> Hunk #2 succeeded at 1036 with fuzz 2 (offset -241 lines).
> 1 out of 2 hunks FAILED -- rejects in file fs/cifs/smb2pdu.c

Oh nevermind, you already sent the backport for that, sorry for the
noise...

greg k-h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-04-21  8:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 12:48 Patch "CIFS: reconnect thread reschedule itself" has been added to the 4.10-stable tree gregkh
2017-04-20 10:07 ` Germano Percossi
2017-04-20 11:05   ` Greg KH
2017-04-20 11:10     ` Germano Percossi
2017-04-20 11:44       ` Greg KH
2017-04-20 13:07         ` Germano Percossi
2017-04-20 13:34           ` Greg KH
2017-04-21  8:37             ` Greg KH
2017-04-21  8:38               ` Greg KH

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.