Skip to content

Commit

Permalink
sunrpc: add missing newline when printing parameter 'pool_mode' by sysfs
Browse files Browse the repository at this point in the history
When I cat parameter '/sys/module/sunrpc/parameters/pool_mode', it
displays as follows. It is better to add a newline for easy reading.

[root@hulk-202 ~]# cat /sys/module/sunrpc/parameters/pool_mode
global[root@hulk-202 ~]#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Xiongfeng Wang authored and J. Bruce Fields committed May 12, 2020
1 parent 44fb26c commit 746c623
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ param_get_pool_mode(char *buf, const struct kernel_param *kp)
switch (*ip)
{
case SVC_POOL_AUTO:
return strlcpy(buf, "auto", 20);
return strlcpy(buf, "auto\n", 20);
case SVC_POOL_GLOBAL:
return strlcpy(buf, "global", 20);
return strlcpy(buf, "global\n", 20);
case SVC_POOL_PERCPU:
return strlcpy(buf, "percpu", 20);
return strlcpy(buf, "percpu\n", 20);
case SVC_POOL_PERNODE:
return strlcpy(buf, "pernode", 20);
return strlcpy(buf, "pernode\n", 20);
default:
return sprintf(buf, "%d", *ip);
return sprintf(buf, "%d\n", *ip);
}
}

Expand Down

0 comments on commit 746c623

Please sign in to comment.