Skip to content

Commit 7246210

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: refcount only the selected iface during interface update
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: b54034a ("cifs: during reconnect, update interface if necessary") Cc: [email protected] # 5.19+ Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 39a154f commit 7246210

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/sess.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
292292
continue;
293293
}
294294
kref_get(&iface->refcount);
295+
break;
295296
}
296297

297-
if (!list_entry_is_head(iface, &ses->iface_list, iface_head)) {
298+
if (list_entry_is_head(iface, &ses->iface_list, iface_head)) {
298299
rc = 1;
299300
iface = NULL;
300301
cifs_dbg(FYI, "unable to find a suitable iface\n");

0 commit comments

Comments
 (0)