diff options
| author | Enzo Matsumiya <ematsumiya@suse.de> | 2025-05-21 16:25:53 +0200 |
|---|---|---|
| committer | Enzo Matsumiya <ematsumiya@suse.de> | 2025-05-22 14:02:48 +0200 |
| commit | 192a0f9ef43af2d520ed4ac016595992660d24e0 (patch) | |
| tree | c9cc854c84eecf159b8605d9dfc6ad269c89cbea /fs/smb/client/cifs_debug.c | |
| parent | a87cf769d6b0be1a0e733e33945f3d6ba468240b (diff) | |
| download | linux-multichannel-fixes-v2.tar.gz linux-multichannel-fixes-v2.tar.bz2 linux-multichannel-fixes-v2.zip | |
smb: client: set interface for primary channelmultichannel-fixes-v2
On multichannel mounts, 2 sockets are created for the primary channel,
as the interface it's connected to is received and parsed/added again.
So compare ifaces IP with primary channel server IP (server->dstaddr)
and assign the matching iface to ses->chans[0].iface.
Add a ->is_primary flag to cifs_server_iface to allow skipping session
setup on the primary channel, and for pretty-printing on cifs_debug.c
as well.
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Diffstat (limited to 'fs/smb/client/cifs_debug.c')
| -rw-r--r-- | fs/smb/client/cifs_debug.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index 0c2acc4e2cbb..34166040569c 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -212,22 +212,16 @@ static inline const char *smb_speed_to_str(size_t bps) static void cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface) { - struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr; - struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr; - seq_printf(m, "\tSpeed: %s\n", smb_speed_to_str(iface->speed)); seq_puts(m, "\t\tCapabilities: "); if (iface->rdma_capable) - seq_puts(m, "rdma "); + seq_puts(m, "RDMA "); if (iface->rss_capable) - seq_puts(m, "rss "); + seq_puts(m, "RSS "); if (!iface->rdma_capable && !iface->rss_capable) - seq_puts(m, "None"); + seq_puts(m, "NONE"); seq_putc(m, '\n'); - if (iface->sockaddr.ss_family == AF_INET) - seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr); - else if (iface->sockaddr.ss_family == AF_INET6) - seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr); + seq_printf(m, "\t\tIP: %pIS\n", (struct sockaddr *)&iface->sockaddr); if (!iface->is_active) seq_puts(m, "\t\t[for-cleanup]\n"); } @@ -602,7 +596,8 @@ skip_rdma: iface->num_channels); if (is_ses_using_iface(ses, iface)) - seq_puts(m, "\t\t[CONNECTED]\n"); + seq_printf(m, "\t\t[CONNECTED]%s\n", + iface->is_primary ? " (PRIMARY)" : ""); } spin_unlock(&server->iface_lock); |
