From: zhang.guodong@linux.dev
To: smfrench@gmail.com, linkinjeon@kernel.org, pc@manguebit.org,
ronniesahlberg@gmail.com, sprasad@microsoft.com, tom@talpey.com,
bharathsm@microsoft.com, senozhatsky@chromium.org,
dhowells@redhat.com, chenxiaosong@kylinos.cn,
chenxiaosong.chenxiaosong@linux.dev
Cc: linux-cifs@vger.kernel.org,
ZhangGuoDong <zhangguodong@kylinos.cn>,
Steve French <stfrench@microsoft.com>
Subject: [PATCH v3 1/5] smb: move smb3_fs_vol_info into common/fscc.h
Date: Mon, 16 Feb 2026 08:20:14 +0000 [thread overview]
Message-ID: <20260216082018.156695-2-zhang.guodong@linux.dev> (raw)
In-Reply-To: <20260216082018.156695-1-zhang.guodong@linux.dev>
From: ZhangGuoDong <zhangguodong@kylinos.cn>
The structure definition on the server side is specified in MS-CIFS
2.2.8.2.3, but we should instead refer to MS-FSCC 2.5.9, just as the
client side does.
Modify the following places:
- filesystem_vol_info -> smb3_fs_vol_info
- SerialNumber -> VolumeSerialNumber
- VolumeLabelSize -> VolumeLabelLength
Then move it into common header file.
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: Steve French <stfrench@microsoft.com>
---
fs/smb/common/fscc.h | 11 +++++++++++
fs/smb/common/smb2pdu.h | 11 -----------
fs/smb/server/smb2pdu.c | 10 +++++-----
fs/smb/server/smb_common.h | 8 --------
4 files changed, 16 insertions(+), 24 deletions(-)
diff --git a/fs/smb/common/fscc.h b/fs/smb/common/fscc.h
index 0123f34db1e8..d2e00eba1a98 100644
--- a/fs/smb/common/fscc.h
+++ b/fs/smb/common/fscc.h
@@ -138,6 +138,17 @@ typedef struct {
__le32 BytesPerSector;
} __packed FILE_SYSTEM_SIZE_INFO; /* size info, level 0x103 */
+/* volume info struct - see MS-FSCC 2.5.9 */
+#define MAX_VOL_LABEL_LEN 32
+struct smb3_fs_vol_info {
+ __le64 VolumeCreationTime;
+ __le32 VolumeSerialNumber;
+ __le32 VolumeLabelLength; /* includes trailing null */
+ __u8 SupportsObjects; /* True if eg like NTFS, supports objects */
+ __u8 Reserved;
+ __u8 VolumeLabel[]; /* variable len */
+} __packed;
+
/* See MS-FSCC 2.5.10 */
typedef struct {
__le32 DeviceType;
diff --git a/fs/smb/common/smb2pdu.h b/fs/smb/common/smb2pdu.h
index e482c86ceb00..69dd7c792804 100644
--- a/fs/smb/common/smb2pdu.h
+++ b/fs/smb/common/smb2pdu.h
@@ -1942,17 +1942,6 @@ struct smb2_fs_control_info {
__le32 Padding;
} __packed;
-/* volume info struct - see MS-FSCC 2.5.9 */
-#define MAX_VOL_LABEL_LEN 32
-struct smb3_fs_vol_info {
- __le64 VolumeCreationTime;
- __u32 VolumeSerialNumber;
- __le32 VolumeLabelLength; /* includes trailing null */
- __u8 SupportsObjects; /* True if eg like NTFS, supports objects */
- __u8 Reserved;
- __u8 VolumeLabel[]; /* variable len */
-} __packed;
-
/* See MS-SMB2 2.2.23 through 2.2.25 */
struct smb2_oplock_break {
struct smb2_hdr hdr;
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index cbb31efdbaa2..966a499d2eb8 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -5531,11 +5531,11 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
}
case FS_VOLUME_INFORMATION:
{
- struct filesystem_vol_info *info;
+ struct smb3_fs_vol_info *info;
size_t sz;
unsigned int serial_crc = 0;
- info = (struct filesystem_vol_info *)(rsp->Buffer);
+ info = (struct smb3_fs_vol_info *)(rsp->Buffer);
info->VolumeCreationTime = 0;
serial_crc = crc32_le(serial_crc, share->name,
strlen(share->name));
@@ -5544,14 +5544,14 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
serial_crc = crc32_le(serial_crc, ksmbd_netbios_name(),
strlen(ksmbd_netbios_name()));
/* Taking dummy value of serial number*/
- info->SerialNumber = cpu_to_le32(serial_crc);
+ info->VolumeSerialNumber = cpu_to_le32(serial_crc);
len = smbConvertToUTF16((__le16 *)info->VolumeLabel,
share->name, PATH_MAX,
conn->local_nls, 0);
len = len * 2;
- info->VolumeLabelSize = cpu_to_le32(len);
+ info->VolumeLabelLength = cpu_to_le32(len);
info->Reserved = 0;
- sz = sizeof(struct filesystem_vol_info) + len;
+ sz = sizeof(struct smb3_fs_vol_info) + len;
rsp->OutputBufferLength = cpu_to_le32(sz);
break;
}
diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h
index ca7e3610d074..b090b56743c4 100644
--- a/fs/smb/server/smb_common.h
+++ b/fs/smb/server/smb_common.h
@@ -90,14 +90,6 @@ struct smb_negotiate_rsp {
__le16 ByteCount;
} __packed;
-struct filesystem_vol_info {
- __le64 VolumeCreationTime;
- __le32 SerialNumber;
- __le32 VolumeLabelSize;
- __le16 Reserved;
- __le16 VolumeLabel[];
-} __packed;
-
#define EXTENDED_INFO_MAGIC 0x43667364 /* Cfsd */
#define STRING_LENGTH 28
--
2.52.0
next prev parent reply other threads:[~2026-02-16 8:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 8:20 [PATCH v3 0/5] smb: move duplicate definitions into common header file, part 2 zhang.guodong
2026-02-16 8:20 ` zhang.guodong [this message]
2026-02-16 16:05 ` [PATCH v3 1/5] smb: move smb3_fs_vol_info into common/fscc.h kernel test robot
2026-02-16 8:20 ` [PATCH v3 2/5] smb: move some definitions from common/smb2pdu.h " zhang.guodong
2026-02-16 8:20 ` [PATCH v3 3/5] smb: move file_basic_info " zhang.guodong
2026-02-16 8:20 ` [PATCH v3 4/5] smb: introduce struct create_posix_ctxt_rsp zhang.guodong
2026-02-16 18:22 ` kernel test robot
2026-02-17 14:20 ` ZhangGuoDong
[not found] ` <CAH2r5muK5WrHkJsJ=Rix7ceFFZNzpQkUZSaSsHi8PMXVpw88pw@mail.gmail.com>
[not found] ` <b840459a-8a31-46e7-817a-3b80e9ed1353@linux.dev>
[not found] ` <CAH2r5muScb7NmeJa1BNwAt8Qzb7WmwVfvskZ=9LEV6WWyO5HyQ@mail.gmail.com>
[not found] ` <d6149e9f-9607-4379-a74d-c4bbe12fef00@linux.dev>
2026-02-19 8:16 ` ChenXiaoSong
2026-02-19 13:14 ` ChenXiaoSong
2026-02-16 8:20 ` [PATCH v3 5/5] smb: introduce struct file_posix_info zhang.guodong
2026-02-20 1:27 ` [PATCH v3 0/5] smb: move duplicate definitions into common header file, part 2 Namjae Jeon
2026-02-20 10:54 ` ZhangGuoDong
2026-02-22 7:39 ` ChenXiaoSong
2026-02-22 15:26 ` ChenXiaoSong
2026-02-22 15:42 ` ChenXiaoSong
2026-02-25 3:14 ` ZhangGuoDong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260216082018.156695-2-zhang.guodong@linux.dev \
--to=zhang.guodong@linux.dev \
--cc=bharathsm@microsoft.com \
--cc=chenxiaosong.chenxiaosong@linux.dev \
--cc=chenxiaosong@kylinos.cn \
--cc=dhowells@redhat.com \
--cc=linkinjeon@kernel.org \
--cc=linux-cifs@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=ronniesahlberg@gmail.com \
--cc=senozhatsky@chromium.org \
--cc=smfrench@gmail.com \
--cc=sprasad@microsoft.com \
--cc=stfrench@microsoft.com \
--cc=tom@talpey.com \
--cc=zhangguodong@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox