summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/util.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-01-21 03:16:25 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 23:08:14 +0200
commitdbaee468461bfa82e6453ca0e009e9661cc570da (patch)
treeb72ea117c6f92dd8476a6c139994641887cf94e3 /fs/bcachefs/util.c
parentbcachefs: dio arithmetic improvements (diff)
downloadlinux-dbaee468461bfa82e6453ca0e009e9661cc570da.tar.xz
linux-dbaee468461bfa82e6453ca0e009e9661cc570da.zip
bcachefs: fix error message in device remove path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/util.c')
-rw-r--r--fs/bcachefs/util.c6
1 files changed, 5 insertions, 1 deletions
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;
}
}