Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

smb: move filesystem_vol_info into common/fscc.h

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:

- smb3_fs_vol_info -> filesystem_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>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

ZhangGuoDong and committed by
Steve French
95e1d378 31884d4b

+18 -25
+4 -4
fs/smb/client/smb2pdu.c
··· 6147 6147 max_len = sizeof(struct smb3_fs_ss_info); 6148 6148 min_len = sizeof(struct smb3_fs_ss_info); 6149 6149 } else if (level == FS_VOLUME_INFORMATION) { 6150 - max_len = sizeof(struct smb3_fs_vol_info) + MAX_VOL_LABEL_LEN; 6151 - min_len = sizeof(struct smb3_fs_vol_info); 6150 + max_len = sizeof(struct filesystem_vol_info) + MAX_VOL_LABEL_LEN; 6151 + min_len = sizeof(struct filesystem_vol_info); 6152 6152 } else { 6153 6153 cifs_dbg(FYI, "Invalid qfsinfo level %d\n", level); 6154 6154 return -EINVAL; ··· 6203 6203 tcon->perf_sector_size = 6204 6204 le32_to_cpu(ss_info->PhysicalBytesPerSectorForPerf); 6205 6205 } else if (level == FS_VOLUME_INFORMATION) { 6206 - struct smb3_fs_vol_info *vol_info = (struct smb3_fs_vol_info *) 6206 + struct filesystem_vol_info *vol_info = (struct filesystem_vol_info *) 6207 6207 (offset + (char *)rsp); 6208 - tcon->vol_serial_number = vol_info->VolumeSerialNumber; 6208 + tcon->vol_serial_number = le32_to_cpu(vol_info->VolumeSerialNumber); 6209 6209 tcon->vol_create_time = vol_info->VolumeCreationTime; 6210 6210 } 6211 6211
+11
fs/smb/common/fscc.h
··· 447 447 __le32 BytesPerSector; 448 448 } __packed FILE_SYSTEM_SIZE_INFO; /* size info, level 0x103 */ 449 449 450 + /* volume info struct - see MS-FSCC 2.5.9 */ 451 + #define MAX_VOL_LABEL_LEN 32 452 + struct filesystem_vol_info { 453 + __le64 VolumeCreationTime; 454 + __le32 VolumeSerialNumber; 455 + __le32 VolumeLabelLength; /* includes trailing null */ 456 + __u8 SupportsObjects; /* True if eg like NTFS, supports objects */ 457 + __u8 Reserved; 458 + __u8 VolumeLabel[]; /* variable len */ 459 + } __packed; 460 + 450 461 /* See MS-FSCC 2.5.10 */ 451 462 typedef struct { 452 463 __le32 DeviceType;
-11
fs/smb/common/smb2pdu.h
··· 1635 1635 */ 1636 1636 } __packed; 1637 1637 1638 - /* volume info struct - see MS-FSCC 2.5.9 */ 1639 - #define MAX_VOL_LABEL_LEN 32 1640 - struct smb3_fs_vol_info { 1641 - __le64 VolumeCreationTime; 1642 - __u32 VolumeSerialNumber; 1643 - __le32 VolumeLabelLength; /* includes trailing null */ 1644 - __u8 SupportsObjects; /* True if eg like NTFS, supports objects */ 1645 - __u8 Reserved; 1646 - __u8 VolumeLabel[]; /* variable len */ 1647 - } __packed; 1648 - 1649 1638 /* See MS-SMB2 2.2.23 through 2.2.25 */ 1650 1639 struct smb2_oplock_break { 1651 1640 struct smb2_hdr hdr;
+3 -2
fs/smb/server/smb2pdu.c
··· 5583 5583 serial_crc = crc32_le(serial_crc, ksmbd_netbios_name(), 5584 5584 strlen(ksmbd_netbios_name())); 5585 5585 /* Taking dummy value of serial number*/ 5586 - info->SerialNumber = cpu_to_le32(serial_crc); 5586 + info->VolumeSerialNumber = cpu_to_le32(serial_crc); 5587 5587 len = smbConvertToUTF16((__le16 *)info->VolumeLabel, 5588 5588 share->name, PATH_MAX, 5589 5589 conn->local_nls, 0); 5590 5590 len = len * 2; 5591 - info->VolumeLabelSize = cpu_to_le32(len); 5591 + info->VolumeLabelLength = cpu_to_le32(len); 5592 5592 info->Reserved = 0; 5593 + info->SupportsObjects = 0; 5593 5594 sz = sizeof(struct filesystem_vol_info) + len; 5594 5595 rsp->OutputBufferLength = cpu_to_le32(sz); 5595 5596 break;
-8
fs/smb/server/smb_common.h
··· 90 90 __le16 ByteCount; 91 91 } __packed; 92 92 93 - struct filesystem_vol_info { 94 - __le64 VolumeCreationTime; 95 - __le32 SerialNumber; 96 - __le32 VolumeLabelSize; 97 - __le16 Reserved; 98 - __le16 VolumeLabel[]; 99 - } __packed; 100 - 101 93 #define EXTENDED_INFO_MAGIC 0x43667364 /* Cfsd */ 102 94 #define STRING_LENGTH 28 103 95