bcachefs: Ensure sysfs show fns print a newline

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
Kent Overstreet 2022-04-14 20:30:30 -04:00 committed by Kent Overstreet
parent 75c8d0305a
commit 42796f74f4

View File

@ -55,6 +55,9 @@ static ssize_t fn ## _show(struct kobject *kobj, struct attribute *attr,\
struct printbuf out = PRINTBUF; \
ssize_t ret = fn ## _to_text(&out, kobj, attr); \
\
if (out.pos && out.buf[out.pos - 1] != '\n') \
pr_newline(&out); \
\
if (!ret && out.allocation_failure) \
ret = -ENOMEM; \
\