diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-04-14 20:30:30 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:31 -0400 |
commit | 42796f74f42ea5b7d9f2d7df661a87d1425968bf (patch) | |
tree | 143a541bd8bd0096d15e8a7dc6057c430eff66f8 /fs/bcachefs/sysfs.c | |
parent | 75c8d0305a5eecbe84b8ffef20e1c049f30f4123 (diff) | |
download | linux-42796f74f42ea5b7d9f2d7df661a87d1425968bf.tar.gz linux-42796f74f42ea5b7d9f2d7df661a87d1425968bf.tar.bz2 linux-42796f74f42ea5b7d9f2d7df661a87d1425968bf.zip |
bcachefs: Ensure sysfs show fns print a newline
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/sysfs.c')
-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 c0cc6e9a3e05..24180d98fe81 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; \ \ |