[22/22] lnet: procs: print new line based on distro
diff mbox series

Message ID 1591146001-27171-23-git-send-email-jsimmons@infradead.org
State New
Headers show
Series
  • lustre: OpenSFS backport patches for May 29 2020
Related show

Commit Message

James Simmons June 3, 2020, 1 a.m. UTC
From: Yang Sheng <ys@whamcloud.com>

Since upstream changed to print new line in module
parameter callback instead of kernel self. So we
need test output of param_get_byte to determine
whether output the new line.
(upstream: v4.14-rc3-148-g96802e6b1dbf)
Also output filename and file content when test
failed for santy 133h.

Lustre-commit: 0130d70195346 ("LU-10401 procs: print new line based on distro")
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38699
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/libcfs/debug.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/net/lnet/libcfs/debug.c b/net/lnet/libcfs/debug.c
index 41a0a5e..dd03520 100644
--- a/net/lnet/libcfs/debug.c
+++ b/net/lnet/libcfs/debug.c
@@ -129,7 +129,9 @@  static int param_get_delay(char *buffer, const struct kernel_param *kp)
 {
 	unsigned int d = *(unsigned int *)kp->arg;
 
-	return sprintf(buffer, "%lu", jiffies_to_msecs(d * 10) / MSEC_PER_SEC);
+	param_get_byte(buffer, kp);
+	return sprintf(buffer, "%lu%c", jiffies_to_msecs(d * 10) / MSEC_PER_SEC,
+		       strnchr(buffer, PAGE_SIZE, '\n') ? '\n' : '\0');
 }
 
 unsigned int libcfs_console_max_delay;