mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: xie.ludan@zte.com.cn, mark@fasheh.com
Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
	akpm@linux-foundation.org, viro@zeniv.linux.org.uk,
	brauner@kernel.org, danielyangkang@gmail.com,
	dmantipov@yandex.ru, ocfs2-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-next] ocfs2: use sysfs_emit() instead of scnprintf().
Date: Mon, 17 Mar 2025 07:20:54 +0100	[thread overview]
Message-ID: <feb009f6-79b9-499e-a909-3d27c4fb9fad@kernel.org> (raw)
In-Reply-To: <20250315141640564lv7R0CwIRPsmittXXjLbB@zte.com.cn>

On 15. 03. 25, 7:16, xie.ludan@zte.com.cn wrote:
> From: XieLudan <xie.ludan@zte.com.cn>
> 
> 
> Follow the advice in Documentation/filesystems/sysfs.rst:
> 
> show() should only use sysfs_emit() or sysfs_emit_at() when formatting
> 
> the value to be returned to user space.
> 
> 
> Signed-off-by: XieLudan <xie.ludan@zte.com.cn>
> 
> ---
> 
>   fs/ocfs2/cluster/heartbeat.c | 10 +++++-----
> 
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> 
> diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
> 
> index 724350925aff..8282fc193906 100644
> 
> --- a/fs/ocfs2/cluster/heartbeat.c
> 
> +++ b/fs/ocfs2/cluster/heartbeat.c
> 
> @@ -1308,7 +1308,7 @@ static int o2hb_debug_open(struct inode *inode, 
> struct file *file)
> 
> case O2HB_DB_TYPE_REGION_NUMBER:
> 
> reg = (struct o2hb_region *)db->db_data;
> 
> -out += scnprintf(buf + out, PAGE_SIZE - out, "%d\n",
> 
> +out += sysfs_emit(buf + out, "%d\n",


This is wrong too [1].

[1] 
https://lore.kernel.org/all/9c552d9a-2d46-4069-a9c4-35fab857bfc3@kernel.org/

regards,
-- 
js
suse labs


      reply	other threads:[~2025-03-17  6:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-15  6:16 xie.ludan
2025-03-17  6:20 ` Jiri Slaby [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=feb009f6-79b9-499e-a909-3d27c4fb9fad@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=danielyangkang@gmail.com \
    --cc=dmantipov@yandex.ru \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xie.ludan@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®