linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] smb: Display volume serial number for shares in /proc/fs/cifs/DebugData
@ 2019-03-12  6:48 Steve French
  0 siblings, 0 replies; only message in thread
From: Steve French @ 2019-03-12  6:48 UTC (permalink / raw)
  To: CIFS

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

Can be helpful for debugging

Add volume serial number to /proc/fs/cifs/DebugData info on each share e.g.:

    Shares:
    0) IPC: \\localhost\IPC$ Mounts: 1 DevInfo: 0x0 Attributes: 0x0
    PathComponentMax: 0 Status: 1 type: 0 Serial Number: 0x0
    Share Capabilities: None    Share Flags: 0x0
    tid: 0xf13518ce    Maximal Access: 0x1f00a9

    1) \\localhost\scratch Mounts: 1 DevInfo: 0x20 Attributes: 0x1006f
    PathComponentMax: 255 Status: 1 type: DISK Serial Number: 0xd50e5aa0
    Share Capabilities: None Aligned, Partition Aligned,    Share Flags: 0x0
    tid: 0xb792fd24    Optimal sector size: 0x200    Maximal Access: 0x1f01ff


-- 
Thanks,

Steve

[-- Attachment #2: 0001-smb3-display-volume-serial-number-for-shares-in-proc.patch --]
[-- Type: text/x-patch, Size: 1133 bytes --]

From b6f0b10482ac6d2a1b968b736de5c049c60f8291 Mon Sep 17 00:00:00 2001
From: Steve French <stfrench@microsoft.com>
Date: Tue, 12 Mar 2019 01:29:03 -0500
Subject: [PATCH] smb3: display volume serial number for shares in
 /proc/fs/cifs/DebugData

It can be helpful for debugging.  According to MS-FSCC:

"A 32-bit unsigned integer that contains the serial number of the
volume. The serial number is an opaque value generated by the file
system at format time"

Signed-off-by: Steve French <stfrench@microsoft.com>
---
 fs/cifs/cifs_debug.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index faeb1452cc2d..13c1288b04a7 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -115,6 +115,9 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon)
 		seq_puts(m, " type: CDROM ");
 	else
 		seq_printf(m, " type: %d ", dev_type);
+
+	seq_printf(m, "Serial Number: 0x%x", tcon->vol_serial_number);
+
 	if ((tcon->seal) ||
 	    (tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) ||
 	    (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA))
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-03-12  6:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12  6:48 [PATCH] smb: Display volume serial number for shares in /proc/fs/cifs/DebugData Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).