Re: [PATCH] fs/gfs2: use scnprintf() in show functions
From: Greg KH
Date: Mon Jun 16 2025 - 10:28:11 EST
On Mon, Jun 16, 2025 at 04:26:26PM +0530, Pranav Tyagi wrote:
> Replace all snprintf() instances with scnprintf(). snprintf() returns
> the number of bytes that would have been written had there been enough
> space. For sysfs attributes, snprintf() should not be used with the
> show() method. Instead use scnprintf() which returns the number of bytes
> actually written.
>
> Signed-off-by: Pranav Tyagi <pranav.tyagi03@xxxxxxxxx>
> ---
> fs/gfs2/sys.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
sysfs_emit() or no change at all please.