btrfs: use super_set_uuid to support FS_IOC_GETFSUUID
PATCH 1/1 btrfs: use super_set_uuid to support FS_IOC_GETFSUUID
Currently, FS_IOC_GETFSUUID fails with ENOTTY. To fix that we should use super_set_uuid() as other filesystems do.
Reported-by Lennart Poettering <[email protected]>
Signed-off-by Alexander Mikhalitsyn <[email protected]>
--- fs/btrfs/disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
@@ -3616,9 +3616,9 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device* on-disk UUID directly from the super_copy. */ if (fs_info->fs_devices->temp_fsid) -memcpy (&sb->s_uuid, fs_info->super_copy->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->super_copy->fsid,BTRFS_FSID_SIZE );else -memcpy (&sb->s_uuid, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE );mutex_lock (&fs_info->chunk_mutex); ret =btrfs_read_sys_array (fs_info);
Signature · 1 line
2.47.3
Quoted 5 lines · Alexander Mikhalitsyn
Currently,
FS_IOC_GETFSUUIDfails with ENOTTY. To fix that we should usesuper_set_uuid()as other filesystems do.Reported-by Lennart Poettering <[email protected]>Signed-off-by Alexander Mikhalitsyn <[email protected]>
Reviewed-by Qu Wenruo <[email protected]>
Will push it for for-next if no other review.
Thanks,
Qu
Quoted 20 lines
--- fs/btrfs/disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/btrfs/disk-io.c +2
-2@@ -3616,9 +3616,9 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device* on-disk UUID directly from the super_copy. */ if (fs_info->fs_devices->temp_fsid) -memcpy (&sb->s_uuid, fs_info->super_copy->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->super_copy->fsid,BTRFS_FSID_SIZE );else -memcpy (&sb->s_uuid, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE );mutex_lock (&fs_info->chunk_mutex); ret =btrfs_read_sys_array (fs_info);
Quoted 9 lines · Qu Wenruo
Quoted 5 lines · Alexander Mikhalitsyn
Currently,
FS_IOC_GETFSUUIDfails with ENOTTY. To fix that we should usesuper_set_uuid()as other filesystems do.Reported-by Lennart Poettering <[email protected]>Signed-off-by Alexander Mikhalitsyn <[email protected]>
Dear Qu,
Quoted 4 lines
Reviewed-by Qu Wenruo <[email protected]>Will push it for for-next if no other review.
thank you very much for such a fast review ;-)
Kind regards,
Alex
Quoted 25 lines
Thanks,
QuQuoted 20 lines
--- fs/btrfs/disk-io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/btrfs/disk-io.c +2
-2@@ -3616,9 +3616,9 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device* on-disk UUID directly from the super_copy. */ if (fs_info->fs_devices->temp_fsid) -memcpy (&sb->s_uuid, fs_info->super_copy->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->super_copy->fsid,BTRFS_FSID_SIZE );else -memcpy (&sb->s_uuid, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE ); +super_set_uuid (sb, fs_info->fs_devices->fsid,BTRFS_FSID_SIZE );mutex_lock (&fs_info->chunk_mutex); ret =btrfs_read_sys_array (fs_info);