Commit dbaee468 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: fix error message in device remove path

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 919dbbd1
...@@ -1258,7 +1258,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags) ...@@ -1258,7 +1258,7 @@ int bch2_dev_remove(struct bch_fs *c, struct bch_dev *ca, int flags)
if (data) { if (data) {
char data_has_str[100]; char data_has_str[100];
bch2_string_opt_to_text(&PBUF(data_has_str), bch2_flags_to_text(&PBUF(data_has_str),
bch2_data_types, data); bch2_data_types, data);
bch_err(ca, "Remove failed, still has data (%s)", data_has_str); bch_err(ca, "Remove failed, still has data (%s)", data_has_str);
ret = -EBUSY; ret = -EBUSY;
......
...@@ -134,6 +134,7 @@ void bch2_flags_to_text(struct printbuf *out, ...@@ -134,6 +134,7 @@ void bch2_flags_to_text(struct printbuf *out,
const char * const list[], u64 flags) const char * const list[], u64 flags)
{ {
unsigned bit, nr = 0; unsigned bit, nr = 0;
bool first = true;
if (out->pos != out->end) if (out->pos != out->end)
*out->pos = '\0'; *out->pos = '\0';
...@@ -142,7 +143,10 @@ void bch2_flags_to_text(struct printbuf *out, ...@@ -142,7 +143,10 @@ void bch2_flags_to_text(struct printbuf *out,
nr++; nr++;
while (flags && (bit = __ffs(flags)) < 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; flags ^= 1 << bit;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment