Skip to content

Commit 096bbee

Browse files
committed
smb3: interface count displayed incorrectly
The "Server interfaces" count in /proc/fs/cifs/DebugData increases as the interfaces are requeried, rather than being reset to the new value. This could cause a problem if the server disabled multichannel as the iface_count is checked in try_adding_channels to see if multichannel still supported. Also fixes a coverity warning: Addresses-Coverity: 1526374 ("Concurrent data access violations (MISSING_LOCK)") Cc: <[email protected]> Reviewed-by: Bharath SM <[email protected]> Reviewed-by: Shyam Prasad N <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 30b2d7f commit 096bbee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cifs/smb2ops.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
530530
p = buf;
531531

532532
spin_lock(&ses->iface_lock);
533+
ses->iface_count = 0;
533534
/*
534535
* Go through iface_list and do kref_put to remove
535536
* any unused ifaces. ifaces in use will be removed
@@ -651,9 +652,9 @@ parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
651652
kref_put(&iface->refcount, release_iface);
652653
} else
653654
list_add_tail(&info->iface_head, &ses->iface_list);
654-
spin_unlock(&ses->iface_lock);
655655

656656
ses->iface_count++;
657+
spin_unlock(&ses->iface_lock);
657658
ses->iface_last_update = jiffies;
658659
next_iface:
659660
nb_iface++;

0 commit comments

Comments
 (0)