Linux EXT4 FS development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wesley Atwell" <atwellwea@gmail.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] ext2: report failed synchronous inode writes during truncate
Date: Sat, 28 Nov 2026 21:23:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-239041@kernel.org> (raw)
In-Reply-To: <kernel-5e344791e4b04a67-v1.atwellwea@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ext2: missing Fixes trailer for ext2_setsize() sync error
  propagation fix
--

commit 65c13ff61e7134c48b27bdd36d3a80ac61957d49
Author: Wesley Atwell <atwellwea@gmail.com>

> ext2: report failed synchronous inode writes during truncate
>
> For a file marked synchronous with chattr +S, ext2_setsize() writes the
> changed inode metadata before returning from truncate. It currently
> ignores the result of sync_inode_metadata(). If the inode-table write
> fails, a caller can receive success even though the new size was not
> persisted.
>
> On an unmodified kernel from the ext2 for_next tree, a QEMU guest used
> GNU truncate to clear an 8 KiB ext2 file marked +S. A targeted write
> error on that file's inode-table block was reported by ext2, but
> ftruncate() returned 0. After an abrupt guest stop and a fault-free
> read-only mount, the original file and its hash remained. Two separate
> fault runs reproduced this result; the healthy control truncated the
> file durably.
>
> Return the synchronous metadata-write result through ext2_setsize() and
> its existing ext2_setattr() caller. With the same fault, GNU truncate
> now receives EIO in two runs; the healthy control still succeeds. This
> reports failed persistence to userspace. It does not roll back changes
> already made in memory or repair the filesystem after a device error.
>
> OpenAI Codex identified the ignored write result, drafted the fix and
> changelog, and prepared the QEMU truncate tests. Both fault runs on the
> changed kernel returned EIO. The healthy controls persisted the new
> file size on both kernels.
>
> Signed-off-by: Wesley Atwell <atwellwea@gmail.com>

[Severity: Low]
This fixes a bug introduced when ext2_truncate() was converted to
ext2_setsize() without propagating the synchronous inode write result.
Should this include:

  Fixes: 737f2e93b972 ("ext2: convert to use the new truncate convention.")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/kernel-5e344791e4b04a67-v1.atwellwea@gmail.com?part=1

      reply	other threads:[~2026-11-28 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 21:19 [PATCH] ext2: report failed synchronous inode writes during truncate Wesley Atwell
2026-11-28 21:23 ` sashiko-bot [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=sashiko-outbox-239041@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=atwellwea@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tytso@mit.edu \
    /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