diff options
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r-- | fs/bcachefs/super.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 8d02a8158520..cc887a1b8c8f 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -605,6 +605,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) { struct bch_sb_field_members *mi; struct bch_fs *c; + struct printbuf name = PRINTBUF; unsigned i, iter_size; int ret = 0; @@ -708,7 +709,13 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts) if (ret) goto err; - uuid_unparse_lower(c->sb.user_uuid.b, c->name); + pr_uuid(&name, c->sb.user_uuid.b); + strlcpy(c->name, name.buf, sizeof(c->name)); + printbuf_exit(&name); + + ret = name.allocation_failure ? -ENOMEM : 0; + if (ret) + goto err; /* Compat: */ if (sb->version <= bcachefs_metadata_version_inode_v2 && @@ -830,7 +837,7 @@ static void print_mount_opts(struct bch_fs *c) bool first = true; if (c->opts.read_only) { - pr_buf(&p, "ro"); + prt_printf(&p, "ro"); first = false; } @@ -845,13 +852,13 @@ static void print_mount_opts(struct bch_fs *c) continue; if (!first) - pr_buf(&p, ","); + prt_printf(&p, ","); first = false; bch2_opt_to_text(&p, c, c->disk_sb.sb, opt, v, OPT_SHOW_MOUNT_STYLE); } if (!p.pos) - pr_buf(&p, "(null)"); + prt_printf(&p, "(null)"); bch_info(c, "mounted version=%s opts=%s", bch2_metadata_versions[c->sb.version], p.buf); printbuf_exit(&p); @@ -1482,7 +1489,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags) if (data) { struct printbuf data_has = PRINTBUF; - bch2_flags_to_text(&data_has, bch2_data_types, data); + prt_bitflags(&data_has, bch2_data_types, data); bch_err(ca, "Remove failed, still has data (%s)", data_has.buf); printbuf_exit(&data_has); ret = -EBUSY; |