Re: [PATCH 21/28] NFS: nfsroot: Refactor root_nfs_cat() to use snprintf()

From
Bill Wendling <morbo@google.com>
Date
2026-09-15 19:30:50
Also in
dri-devel, intel-wired-lan, intel-xe, linux-devicetree, linux-edac, linux-gpio, linux-hardening, linux-input, linux-media, linux-mips, linux-nfs, linux-samsung-soc, linux-scsi, linux-sound, linux-wireless, lkml, loongarch
Reply to
Kees Cook, 2026-09-15
On Tue, Sep 15, 2026 at 11:52 AM Kees Cook [off-list ref] wrote:
On Tue, Sep 15, 2026 at 08:18:38AM +0000, Bill Wendling wrote:
quoted
 fs/nfs/nfsroot.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
This collides with:
https://lore.kernel.org/all/27956255dde39f58d73a7b51cb53cbe3d7804f54.1786411026.git.mariianikitash@google.com/ (local)
quoted
+     ret = snprintf(dest + len, destlen - len, "%s%s",
+                    (len && dest[len - 1] != ',') ? "," : "", src);
I prefer Mariia's version because this inline ternary is difficult
to read.
Agreed. I was trying to not stomp on her work. Please ignore this patch.

-bw
I was expecting to land hers soon if the NFS folks don't pipe up. It is
one of the rare cases of still being open-coded, but the strlen() usage
was pre-existing to check for the trailing comma, so it's not a clean
seq_buf() conversion candidate...

--
Kees Cook
Thread (47 messages) 47 messages, 8 authors, last reply 2026-09-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help