erofs: convert to use super_set_uuid to support for FS_IOC_GETFSUUID
authorHuang Xiaojia <huangxiaojia2@huawei.com>
Mon, 24 Jun 2024 06:37:04 +0000 (14:37 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Wed, 26 Jun 2024 09:02:28 +0000 (17:02 +0800)
FS_IOC_GETFSUUID ioctl exposes the uuid of a filesystem. To support
the ioctl, init sb->s_uuid with super_set_uuid().

Signed-off-by: Huang Xiaojia <huangxiaojia2@huawei.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20240624063704.2476070-1-huangxiaojia2@huawei.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/super.c

index c93bd24d27717264aa972c13850b3cc9bd2419b5..1b91d951301382ed928e3ad76472cfa855e89105 100644 (file)
@@ -343,7 +343,7 @@ static int erofs_read_superblock(struct super_block *sb)
        sbi->build_time = le64_to_cpu(dsb->build_time);
        sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec);
 
-       memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid));
+       super_set_uuid(sb, (void *)dsb->uuid, sizeof(dsb->uuid));
 
        ret = strscpy(sbi->volume_name, dsb->volume_name,
                      sizeof(dsb->volume_name));