mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 21:03:32 +00:00
cifs: refcount only the selected iface during interface update
commit7246210ecd
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:b54034a73b
("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>
This commit is contained in:
parent
a3d8cdde0d
commit
00e2fad019
1 changed files with 2 additions and 1 deletions
|
@ -292,9 +292,10 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
|
|||
continue;
|
||||
}
|
||||
kref_get(&iface->refcount);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!list_entry_is_head(iface, &ses->iface_list, iface_head)) {
|
||||
if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
|
||||
rc = 1;
|
||||
iface = NULL;
|
||||
cifs_dbg(FYI, "unable to find a suitable iface\n");
|
||||
|
|
Loading…
Reference in a new issue