diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-14 20:30:30 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-17 15:44:32 -0400 |
commit | 35567c467043263b840c07bc99ee38049fad4bc4 (patch) | |
tree | 74fef6bcbf288fe955ced6886169af29d34088cb | |
parent | 79b1e374aadf607aaa416043efd420de6f6279b1 (diff) |
bcachefs: Ensure sysfs show fns print a newline
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | fs/bcachefs/sysfs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/sysfs.c b/fs/bcachefs/sysfs.c index 3b68bda63e80..00b9a19aee50 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; \ \ |