cifs: fix interface count calculation during refresh
authorShyam Prasad N <sprasad@microsoft.com>
Thu, 22 Dec 2022 12:54:44 +0000 (12:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:01:55 +0000 (12:01 +0100)
commit76f1ff02e23edf6e4a346743b13a2287cfe5af06
tree1b821cd48ce493e7c1ce43e9a648771826849915
parent0af9640736a61f1404e4d64a088491d24cb0bdb3
cifs: fix interface count calculation during refresh

commit cc7d79d4fad6a4eab3f88c4bb237de72be4478f1 upstream.

The last fix to iface_count did fix the overcounting issue.
However, during each refresh, we could end up undercounting
the iface_count, if a match was found.

Fixing this by doing increments and decrements instead of
setting it to 0 before each parsing of server interfaces.

Fixes: 096bbeec7bd6 ("smb3: interface count displayed incorrectly")
Cc: stable@vger.kernel.org # 6.1
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb2ops.c