summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/super.c')
-rw-r--r--fs/bcachefs/super.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index c7638a3b6c1d..6aba429a15ed 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -53,6 +53,7 @@
#include <linux/idr.h>
#include <linux/module.h>
#include <linux/percpu.h>
+#include <linux/pretty-printers.h>
#include <linux/random.h>
#include <linux/sysfs.h>
#include <crypto/hash.h>
@@ -605,6 +606,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 +710,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 &&
@@ -833,7 +841,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;
}
@@ -848,13 +856,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);
@@ -1487,7 +1495,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;