Commit 3a641257 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French
Browse files

ksmbd: use volume UUID in FS_OBJECT_ID_INFORMATION



Use sb->s_uuid for a proper volume identifier as the primary choice.
For filesystems that do not provide a UUID, fall back to stfs.f_fsid
obtained from vfs_statfs().

Cc: stable@vger.kernel.org
Reported-by: default avatarHyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 282343cf
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5453,7 +5453,6 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
				    struct smb2_query_info_req *req,
				    struct smb2_query_info_rsp *rsp)
{
	struct ksmbd_session *sess = work->sess;
	struct ksmbd_conn *conn = work->conn;
	struct ksmbd_share_config *share = work->tcon->share_conf;
	int fsinfoclass = 0;
@@ -5590,10 +5589,11 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,

		info = (struct object_id_info *)(rsp->Buffer);

		if (!user_guest(sess->user))
			memcpy(info->objid, user_passkey(sess->user), 16);
		if (path.mnt->mnt_sb->s_uuid_len == 16)
			memcpy(info->objid, path.mnt->mnt_sb->s_uuid.b,
					path.mnt->mnt_sb->s_uuid_len);
		else
			memset(info->objid, 0, 16);
			memcpy(info->objid, &stfs.f_fsid, sizeof(stfs.f_fsid));

		info->extended_info.magic = cpu_to_le32(EXTENDED_INFO_MAGIC);
		info->extended_info.version = cpu_to_le32(1);