smb3: fill in statfs fsid and correct namelen
Fil in the correct namelen (typically 255 not 4096) in the statfs response and also fill in a reasonably unique fsid (in this case taken from the volume id, and the creation time of the volume). In the case of the POSIX statfs all fields are now filled in, and in the case of non-POSIX mounts, all fields are filled in which can be. Signed-off-by: Steve French <stfrench@gmail.com> CC: Stable <stable@vger.kernel.org> Reviewed-by: Aurelien Aptel <aaptel@suse.com>
This commit is contained in:
@@ -4045,6 +4045,9 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
} else if (level == FS_SECTOR_SIZE_INFORMATION) {
|
||||
max_len = sizeof(struct smb3_fs_ss_info);
|
||||
min_len = sizeof(struct smb3_fs_ss_info);
|
||||
} else if (level == FS_VOLUME_INFORMATION) {
|
||||
max_len = sizeof(struct smb3_fs_vol_info) + MAX_VOL_LABEL_LEN;
|
||||
min_len = sizeof(struct smb3_fs_vol_info);
|
||||
} else {
|
||||
cifs_dbg(FYI, "Invalid qfsinfo level %d\n", level);
|
||||
return -EINVAL;
|
||||
@@ -4089,6 +4092,11 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
|
||||
tcon->ss_flags = le32_to_cpu(ss_info->Flags);
|
||||
tcon->perf_sector_size =
|
||||
le32_to_cpu(ss_info->PhysicalBytesPerSectorForPerf);
|
||||
} else if (level == FS_VOLUME_INFORMATION) {
|
||||
struct smb3_fs_vol_info *vol_info = (struct smb3_fs_vol_info *)
|
||||
(offset + (char *)rsp);
|
||||
tcon->vol_serial_number = vol_info->VolumeSerialNumber;
|
||||
tcon->vol_create_time = vol_info->VolumeCreationTime;
|
||||
}
|
||||
|
||||
qfsattr_exit:
|
||||
|
Reference in New Issue
Block a user