Re: [PATCH v2 2/2] 9p: skip directory entries with names longer than NAME_MAX

From: Dominique Martinet

Date: Wed Sep 16 2026 - 18:48:13 EST


Christian Schoenebeck wrote on Wed, Sep 16, 2026 at 10:02:08PM +0200:
> > + if (namelen > NAME_MAX) {
> > + p9_debug(P9_DEBUG_VFS,
> > + "skipping entry with %zu byte name\n",
> > + namelen);
>
> Fair to say why:
>
> "skip dentry: name length %zu > NAME_MAX"

Agreed.

I'd also say to keep this as P9_DEBUG_ERROR rather than VFS: it should
be rare enough and nobody will enable DEBUG_VFS immediately, this keeps
the message at the same log level as it was previously

(P9_DEBUG_ERROR is not printed by default, but I've been meaning to
try to change that eventually... Someday™)

> This is only handled for 9p2000.L so far. For legacy 9p2000(.u) this should
> then also be limited in v9fs_dir_readdir() IMO.

In practice this was already the case because of the processing in
p9dirent_read(), so I have no strong opinion here, but I do agree it
makes more sense to be symetrical yes.
If done it should be noted as a behavior change in the commit message
(or split in yet another commit) though

--
Dominique Martinet | Asmadeus