# 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 
- List: netdev
- Page: https://ratatoskr.run/netdev/2026/09/17581771
- Thread: https://ratatoskr.run/loongarch/2026/09/17577947/t.md

```text
On Tue, Sep 15, 2026 at 11:52 AM Kees Cook [ref] wrote:
>
> On Tue, Sep 15, 2026 at 08:18:38AM +0000, Bill Wendling wrote:
> >  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/
>
> > +     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
```
