]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Add support for FS_IOC_GETFSUUID
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 9 Jul 2024 01:11:33 +0000 (09:11 +0800)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 21 Dec 2024 06:36:17 +0000 (01:36 -0500)
Use super_set_uuid() to set `sb->s_uuid_len` to avoid returning `-ENOTTY`
with sb->s_uuid_len being 0.

Original patch link:
[1]: https://lore.kernel.org/all/20240207025624.1019754-2-kent.overstreet@linux.dev/

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fs.c

index 91fce04272a139c900272447e0c7153a68ca91f9..396a8f677621d027a85bbef425ffe06fca02ce37 100644 (file)
@@ -2216,7 +2216,7 @@ got_sb:
        sb->s_time_gran         = c->sb.nsec_per_time_unit;
        sb->s_time_min          = div_s64(S64_MIN, c->sb.time_units_per_sec) + 1;
        sb->s_time_max          = div_s64(S64_MAX, c->sb.time_units_per_sec);
-       sb->s_uuid              = c->sb.user_uuid;
+       super_set_uuid(sb, c->sb.user_uuid.b, sizeof(c->sb.user_uuid));
        sb->s_shrink->seeks     = 0;
        c->vfs_sb               = sb;
        strscpy(sb->s_id, c->name, sizeof(sb->s_id));