From: Damien Le Moal <dlemoal@kernel.org>
To: Jonathan Velez <jonvelez12345@gmail.com>, cassel@kernel.org
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
shuah@kernel.org
Subject: Re: [PATCH] ata: libata-transport: replace scnprintf with sysfs_emit for simple attributes
Date: Tue, 8 Jul 2025 10:15:02 +0900 [thread overview]
Message-ID: <5331758a-528b-42bc-b57a-5735a8b6e4f8@kernel.org> (raw)
In-Reply-To: <20250707122004.224770-1-jonvelez12345@gmail.com>
On 7/7/25 9:20 PM, Jonathan Velez wrote:
> sprintf, snprintf, and scnprintf do not consider the PAGE_SIZE maximum
> of the temporary buffer used for outputting sysfs content and they may
> overrun the PAGE_SIZE buffer length.
>
> To avoid output defects with the ATA transport class simple attributes,
> scnprintf() was converted to sysfs_emit(). This aligns with the sysfs
> guidance provided in Documentation/filesystems/sysfs.rst.
Nit: please use assertive style (no past tense/passive form)
To avoid output defects with the ATA transport class simple attributes,
use sysfs_emit instead of scnprintf().
>
> Signed-off-by: Jonathan Velez <jonvelez12345@gmail.com>
Otherwise, looks good.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-07-08 1:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 12:20 [PATCH] ata: libata-transport: replace scnprintf with sysfs_emit for simple attributes Jonathan Velez
2025-07-08 1:15 ` Damien Le Moal [this message]
2025-07-09 13:16 ` Jonathan Velez
-- strict thread matches above, loose matches on Subject: below --
2025-07-09 13:33 Jonathan Velez
2025-07-09 13:47 ` Niklas Cassel
2025-07-09 13:49 ` Niklas Cassel
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=5331758a-528b-42bc-b57a-5735a8b6e4f8@kernel.org \
--to=dlemoal@kernel.org \
--cc=cassel@kernel.org \
--cc=jonvelez12345@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuah@kernel.org \
/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