Shyam Prasad N 94d0e33c5f cifs: refcount only the selected iface during interface update
commit 7246210ecdd0cda97fa3e3bb15c32c6c2d9a23b5 upstream.

When the server interface for a channel is not active anymore,
we have the logic to select an alternative interface. However
this was not breaking out of the loop as soon as a new alternative
was found. As a result, some interfaces may get refcounted unintentionally.

There was also a bug in checking if we found an alternate iface.
Fixed that too.

Fixes: b54034a73baf ("cifs: during reconnect, update interface if necessary")
Cc: stable@vger.kernel.org # 5.19+
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-12 12:01:55 +01:00
..
2022-10-19 17:57:51 -05:00
2022-12-21 17:48:11 +01:00
2022-12-21 17:48:11 +01:00
2022-10-18 11:33:43 -05:00
2022-01-19 11:21:08 -06:00
2022-12-21 17:48:11 +01:00
2019-01-24 09:37:33 -06:00
2022-10-10 09:10:28 -07:00
2021-04-25 16:28:23 -05:00