From: Christoph Hellwig <hch@infradead.org>
To: Morduan Zang <zhangdandan@uniontech.com>
Cc: hch@infradead.org, brauner@kernel.org, djwong@kernel.org,
linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] iomap: guard io_size EOF trim against concurrent truncate underflow
Date: Thu, 18 Jun 2026 06:36:12 -0700 [thread overview]
Message-ID: <ajP0TDAkqaO5Znyv@infradead.org> (raw)
In-Reply-To: <B234832D26F10C59+20260618110320.545750-1-zhangdandan@uniontech.com>
On Thu, Jun 18, 2026 at 07:03:07PM +0800, Morduan Zang wrote:
> No, I do not have a workload reproducer. I noticed this while reviewing
> the EOF trim in 51d20d1dacbe for backport — our static analysis flagged
> that end_pos - ioend->io_offset is assigned to size_t without ensuring
> end_pos >= ioend->io_offset.
Ok, makes sense.
> If you consider this path unreachable in practice I am happy to drop the
> patch. Otherwise, the guard itself is small and only affects the trim
> branch — I can send a v2 with your suggested ordering if you think it is
> worth hardening even without a reproducer.
I don't think it's impossible. Just curious where this change comes
from and hoping for a reproducer if we can come up with one.
prev parent reply other threads:[~2026-06-18 13:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 5:38 [PATCH] iomap: guard io_size EOF trim against concurrent truncate underflow Morduan Zang
2026-06-18 9:08 ` Christoph Hellwig
2026-06-18 11:03 ` Morduan Zang
2026-06-18 13:36 ` Christoph Hellwig [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=ajP0TDAkqaO5Znyv@infradead.org \
--to=hch@infradead.org \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=zhangdandan@uniontech.com \
/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