On Fri, 2021-01-15 at 10:07 -0800, James Bottomley wrote: > On Fri, 2021-01-15 at 09:26 -0800, James Bottomley wrote: > > On Fri, 2021-01-15 at 14:54 +0100, Greg KH wrote: > > > On Thu, Jan 14, 2021 at 04:21:08PM -0800, James Bottomley wrote: > > [...] > > > > It looks like we already have a couple of bugs in the kernel > > > > introduced by this confusion ... return sysfs_emit() vs return > > > > sysfs_emit_at() being the most tricky ... > > > > > > Hm, Joe, you did the conversion to these functions (and wrote the > > > api), care to review this? > > > > A cursory glance tells me that summary_show in > > drivers/infiniband/hw/usnic/usnic_ib_sysfs.c has a problem, I think > > the last = should be += No, it's correct and overwriting what would otherwise be a trailing space. > The use in drivers/base/node.c:node_read_meminfo() is highly > questionable. While currently not emitting wrong code, it depends on > len being 0 when passed in to sysfs_emit_at(). That argues it should > either be using sysfs_emit() or it should have a len += just in case > something gets prepended that makes len non zero. <shrug>, it's currently correct and would be OK to change to += as len is initialized though I think it's extremely doubtful it would ever be changed. sysfs is ABI right so prepending would break things.