smb3: allow dumping session and tcon id to improve stats analysis and debugging
authorSteve French <stfrench@microsoft.com>
Thu, 9 Nov 2023 21:28:12 +0000 (15:28 -0600)
committerSteve French <stfrench@microsoft.com>
Fri, 10 Nov 2023 08:00:30 +0000 (02:00 -0600)
commitde4eceab578ead12a71e5b5588a57e142bbe8ceb
tree763eb55fd588c7f9aecc8d7a54a7c6823af4afe9
parent5e2fd17f434d2fed78efb123e2fc6711e4f598f1
smb3: allow dumping session and tcon id to improve stats analysis and debugging

When multiple mounts are to the same share from the same client it was not
possible to determine which section of /proc/fs/cifs/Stats (and DebugData)
correspond to that mount.  In some recent examples this turned out to  be
a significant problem when trying to analyze performance data - since
there are many cases where unless we know the tree id and session id we
can't figure out which stats (e.g. number of SMB3.1.1 requests by type,
the total time they take, which is slowest, how many fail etc.) apply to
which mount. The only existing loosely related ioctl CIFS_IOC_GET_MNT_INFO
does not return the information needed to uniquely identify which tcon
is which mount although it does return various flags and device info.

Add a cifs.ko ioctl CIFS_IOC_GET_TCON_INFO (0x800ccf0c) to return tid,
session id, tree connect count.

Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifs_ioctl.h
fs/smb/client/ioctl.c