Linux EXT4 FS development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhang Yi" <yi.zhang@huaweicloud.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH v5 3/4] mm/truncate: fix data loss when splitting straddling large folios fails
Date: Mon, 28 Sep 2026 12:27:20 +0000	[thread overview]
Message-ID: <20260928122721.5FDA01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928120833.3440834-4-yi.zhang@huaweicloud.com>

> From: Zhang Yi <yi.zhang@huawei.com>
> 
> truncate_inode_partial_folio() splits a large folio so that the caller's
> truncate loop can drop the in-range sub-folios while keeping the
> out-of-range tail. The first split at the punch start edge is
> non-uniform, which leaves the sub-folio at the truncation end edge as
> large as possible, this means it may still straddle the range, holding
> both zeroed in-range and valid out-of-range data. The function then
> attempts a second split at offset + length to isolate that tail.
> 
> If the second split fails the straddling sub-folio stays merged. The
> function returned true unconditionally on all exit paths of the success
> block, telling the caller it was fully handled. The caller kept its
> default end and the truncate loop truncated every sub-folio below it,
> including the merged straddler, discarding the valid out-of-range tail.
> [ ... ]
> Fixes: 7460b470a131 ("mm/truncate: use folio_split() in truncate operation")
> 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=3


  reply	other threads:[~2026-09-28 12:27 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
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 [this message]
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=20260928122721.5FDA01F000FF@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox