Skip to content

Commit

Permalink
cifs: fix in logging in cifs_chan_update_iface
Browse files Browse the repository at this point in the history
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 <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Shyam Prasad N authored and Steve French committed Jan 7, 2024
1 parent 9c38568 commit 516eea9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fs/smb/client/sess.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,14 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
}

if (!iface) {
cifs_dbg(FYI, "unable to get the interface matching: %pIS\n",
&ss);
if (!chan_index)
cifs_dbg(FYI, "unable to get the interface matching: %pIS\n",
&ss);
else {
cifs_dbg(FYI, "unable to find another interface to replace: %pIS\n",
&old_iface->sockaddr);
}

spin_unlock(&ses->iface_lock);
return 0;
}
Expand All @@ -459,10 +465,6 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)
iface->weight_fulfilled++;

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

0 comments on commit 516eea9

Please sign in to comment.