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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:20:09 +0000 (17:20 +0000)
commit67062c84922b439071c301afffaf14457fa3569a
tree54a04a616af5153c645405bb945f94846e7c9679
parentb8c0124b2340a210227e735ec0d9487e8f5a61b5
smb3: allow dumping session and tcon id to improve stats analysis and debugging

commit de4eceab578ead12a71e5b5588a57e142bbe8ceb upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/client/cifs_ioctl.h
fs/smb/client/ioctl.c