]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
smb3: allow stats which track session and share reconnects to be reset
authorSteve French <stfrench@microsoft.com>
Sun, 16 Sep 2018 04:04:41 +0000 (23:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:15:09 +0000 (11:15 -0800)
commit 2c887635cd6ab3af619dc2be94e5bf8f2e172b78 upstream.

Currently, "echo 0 > /proc/fs/cifs/Stats" resets all of the stats
except the session and share reconnect counts.  Fix it to
reset those as well.

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifs_debug.c

index 2565cee702e484609808e774a7f81b27a9e87243..106a715101f9fb0c9f9731bb8745213e008aba48 100644 (file)
@@ -289,6 +289,9 @@ static ssize_t cifs_stats_proc_write(struct file *file,
                atomic_set(&totBufAllocCount, 0);
                atomic_set(&totSmBufAllocCount, 0);
 #endif /* CONFIG_CIFS_STATS2 */
+               atomic_set(&tcpSesReconnectCount, 0);
+               atomic_set(&tconInfoReconnectCount, 0);
+
                spin_lock(&GlobalMid_Lock);
                GlobalMaxActiveXid = 0;
                GlobalCurrentXid = 0;