diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-01-20 21:16:25 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:14 -0400 |
commit | dbaee468461bfa82e6453ca0e009e9661cc570da (patch) | |
tree | b72ea117c6f92dd8476a6c139994641887cf94e3 /fs | |
parent | 919dbbd18b590bc3235b96e498a67cc66e4fbb1f (diff) | |
download | linux-stable-dbaee468461bfa82e6453ca0e009e9661cc570da.tar.gz linux-stable-dbaee468461bfa82e6453ca0e009e9661cc570da.tar.bz2 linux-stable-dbaee468461bfa82e6453ca0e009e9661cc570da.zip |
bcachefs: fix error message in device remove path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/super.c | 4 | ||||
-rw-r--r-- | fs/bcachefs/util.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 198f78dbb6d9..55069f40d04b 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1258,8 +1258,8 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags) if (data) { char data_has_str[100]; - bch2_string_opt_to_text(&PBUF(data_has_str), - bch2_data_types, data); + bch2_flags_to_text(&PBUF(data_has_str), + bch2_data_types, data); bch_err(ca, "Remove failed, still has data (%s)", data_has_str); ret = -EBUSY; goto err; diff --git a/fs/bcachefs/util.c b/fs/bcachefs/util.c index d998e51dbc30..9f3eafb3e0d4 100644 --- a/fs/bcachefs/util.c +++ b/fs/bcachefs/util.c @@ -134,6 +134,7 @@ void bch2_flags_to_text(struct printbuf *out, const char * const list[], u64 flags) { unsigned bit, nr = 0; + bool first = true; if (out->pos != out->end) *out->pos = '\0'; @@ -142,7 +143,10 @@ void bch2_flags_to_text(struct printbuf *out, nr++; while (flags && (bit = __ffs(flags)) < nr) { - pr_buf(out, "%s,", list[bit]); + pr_buf(out, "%s", list[bit]); + if (!first) + pr_buf(out, ","); + first = false; flags ^= 1 << bit; } } |