Re: [PATCH] sysfs: clamp show() return value in sysfs_kf_read()

From: Greg Kroah-Hartman

Date: Thu May 21 2026 - 02:21:43 EST


On Wed, May 20, 2026 at 08:19:34AM -1000, Tejun Heo wrote:
> Hello,
>
> Two nits:
>
> - Buffer is atomic_write_len ?: PAGE_SIZE, so probably better to clamp
> to that than hardcode PAGE_SIZE.

Where is that check at? And sysfs_kf_seq_show() doesn't check it this
way, should that change?

> - pr_warn() instead of bare printk()?

This is copying the message in sysfs_kf_seq_show() that has the same
exact format. I will send a follow-on patch to make both the same.

thanks,

greg k-h