Skip to content

Commit 516eea9

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: fix in logging in cifs_chan_update_iface
Recently, cifs_chan_update_iface was modified to not remove an iface if a suitable replacement was not found. With that, there were two conditionals that were exactly the same. This change removes that extra condition check. Also, fixed a logging in the same function to indicate the correct message. Signed-off-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 9c38568 commit 516eea9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

fs/smb/client/sess.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,14 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
440440
}
441441

442442
if (!iface) {
443-
cifs_dbg(FYI, "unable to get the interface matching: %pIS\n",
444-
&ss);
443+
if (!chan_index)
444+
cifs_dbg(FYI, "unable to get the interface matching: %pIS\n",
445+
&ss);
446+
else {
447+
cifs_dbg(FYI, "unable to find another interface to replace: %pIS\n",
448+
&old_iface->sockaddr);
449+
}
450+
445451
spin_unlock(&ses->iface_lock);
446452
return 0;
447453
}
@@ -459,10 +465,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
459465
iface->weight_fulfilled++;
460466

461467
kref_put(&old_iface->refcount, release_iface);
462-
} else if (old_iface) {
463-
/* if a new candidate is not found, keep things as is */
464-
cifs_dbg(FYI, "could not replace iface: %pIS\n",
465-
&old_iface->sockaddr);
466468
} else if (!chan_index) {
467469
/* special case: update interface for primary channel */
468470
if (iface) {

0 commit comments

Comments
 (0)