Re: [PATCH] statmount: retry an overflowed string before reporting -EOVERFLOW

From: Kyuwon Cho

Date: Tue Nov 24 2026 - 08:32:40 EST


Hi Ding,

Moving the check one step further up, above the "seq->count == start"
return, also fixes a case where a string is dropped without any error:

/* signal a retry */
if (unlikely(seq_has_overflowed(seq)))
return -EAGAIN;

if (seq->count == start)
return ret;

The NUL written after a string that ends one byte before the end of the
seq buffer leaves seq->count == seq->size. The next string then emits
nothing, and the early return drops it with no error and no retry. For
example, with a tmpfs mounted on a 12278-byte path, statmount() for
STATMOUNT_FS_TYPE | STATMOUNT_MNT_ROOT | STATMOUNT_MNT_POINT |
STATMOUNT_SB_SOURCE returns 0 without STATMOUNT_SB_SOURCE, with or
without your patch, and returns it with the check moved up.

Could you fold this into a v2?

We found this with an LLM-guided test generator, a research prototype
we are developing.

Thanks,
Kyuwon