Re: [PATCH 1/2] sunrpc: add missing newline when printing parameter 'pool_mode' by sysfs
From: J. Bruce Fields
Date: Mon May 11 2020 - 20:21:27 EST
On Fri, May 08, 2020 at 09:32:59AM +0800, Xiongfeng Wang wrote:
> When I cat parameter '/sys/module/sunrpc/parameters/pool_mode', it
> displays as follows. It is better to add a newline for easy reading.
Applying for 5.8. I assume Trond's getting the other patch.
--b.
>
> [root@hulk-202 ~]# cat /sys/module/sunrpc/parameters/pool_mode
> global[root@hulk-202 ~]#
>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@xxxxxxxxxx>
> ---
> net/sunrpc/svc.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
> index 187dd4e..d8ef47f 100644
> --- a/net/sunrpc/svc.c
> +++ b/net/sunrpc/svc.c
> @@ -88,15 +88,15 @@ struct svc_pool_map svc_pool_map = {
> 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);
> }
> }
>
> --
> 1.7.12.4