mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyuwon Cho <kyuwoncho18@gmail.com>
To: Ding Feng <dingf3ng@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>, Jan Kara <jack@suse.cz>,
	Ian Kent <raven@themaw.net>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] statmount: retry an overflowed string before reporting -EOVERFLOW
Date: Tue, 24 Nov 2026 05:32:33 -0800 (PST)	[thread overview]
Message-ID: <179552693473.1490262.10477620788152048784@gmail.com> (raw)
In-Reply-To: <20261120033644.99834-1-dingf3ng@gmail.com>

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

      reply	other threads:[~2026-11-24 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20  3:36 Ding Feng
2026-11-24 13:32 ` Kyuwon Cho [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179552693473.1490262.10477620788152048784@gmail.com \
    --to=kyuwoncho18@gmail.com \
    --cc=brauner@kernel.org \
    --cc=dingf3ng@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®