From: Kent Overstreet Date: Fri, 15 Apr 2022 00:30:30 +0000 (-0400) Subject: bcachefs: Ensure sysfs show fns print a newline X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=42796f74f42ea5b7d9f2d7df661a87d1425968bf;p=linux.git bcachefs: Ensure sysfs show fns print a newline Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index c0cc6e9a3e055..24180d98fe81a 100644 --- a/fs/bcachefs/sysfs.c +++ b/fs/bcachefs/sysfs.c @@ -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; \ \