From: sashiko-bot@kernel.org
To: "Zhang Yi" <yi.zhang@huaweicloud.com>
Cc: tytso@mit.edu, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v5 2/4] mm/truncate: look up the end-edge straddler by index
Date: Mon, 28 Sep 2026 12:24:17 +0000 [thread overview]
Message-ID: <20260928122417.E4A5B1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928120833.3440834-3-yi.zhang@huaweicloud.com>
> From: Zhang Yi <yi.zhang@huawei.com>
>
> In truncate_inode_partial_folio(), after the first split at the start
> edge, folio_split() unlocks and drops the refcount of the after-split
> sub-folios. The sub-folio straddling the end of the truncation range is
> therefore unlocked and only transiently ref'd in the page cache while
> the code still derives it from a page pointer inside the original folio.
>
> Between the first split finishing and page_folio() resolving split_at2,
> that tail page can be reclaimed, freed and reallocated as a new large
> folio in the same mapping at a different file offset. folio2 then points
> at a folio that does not cover the end boundary, yet
> folio2->mapping == folio->mapping still holds, so the stale pointer
> passes the mapping check and folio_split_or_unmap() splits a folio at a
> wrong position (or, with a transient refcount, a use-after-free window
> [ ... ]
> Suggested-by: Zi Yan <ziy@nvidia.com>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> Acked-by: Zi Yan <ziy@nvidia.com>
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928120833.3440834-1-yi.zhang@huaweicloud.com?part=2
next prev parent reply other threads:[~2026-09-28 12:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 12:08 [PATCH v5 0/4] mm/truncate: fix data loss when truncating straddling large folios Zhang Yi
2026-09-28 12:08 ` [PATCH v5 1/4] mm/truncate: align truncation boundaries to mapping minimum folio order Zhang Yi
2026-09-28 12:31 ` sashiko-bot
2026-09-28 12:46 ` Zhang Yi
2026-09-28 12:08 ` [PATCH v5 2/4] mm/truncate: look up the end-edge straddler by index Zhang Yi
2026-09-28 12:24 ` sashiko-bot [this message]
2026-09-28 12:08 ` [PATCH v5 3/4] mm/truncate: fix data loss when splitting straddling large folios fails Zhang Yi
2026-09-28 12:27 ` sashiko-bot
2026-09-28 12:08 ` [PATCH v5 4/4] mm/truncate: clarify return value of truncate_inode_partial_folio() Zhang Yi
2026-09-28 12:27 ` sashiko-bot
2026-09-28 21:49 ` [PATCH v5 0/4] mm/truncate: fix data loss when truncating straddling large folios Andrew Morton
2026-09-29 8:35 ` Zhang Yi
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=20260928122417.E4A5B1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tytso@mit.edu \
--cc=yi.zhang@huaweicloud.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.