Linux EXT4 FS development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: Alan <3164729207@qq.com>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [PATCH] ext4: reserve inode write access before unlinking entry
Date: Tue, 27 Oct 2026 11:05:02 +0000	[thread overview]
Message-ID: <sashiko-outbox-186411@kernel.org> (raw)
In-Reply-To: <tencent_D60E766CE07D3A1847B81DE9BC37B4466908@qq.com>

> __ext4_unlink() removes the directory entry and dirties the parent inode
> before it updates the target inode's link count. If the inode write access
> operation fails after the directory entry has been removed, unlink returns
> without decrementing the target inode's link count. With errors=continue,
> the directory update can still be committed.
> 
> Reserve write access to the parent and target inode-table buffers before
> removing the directory entry. This makes inode-location and journal-access
> errors fail before the namespace changes. Keep the existing namespace and
> link-count update order, and release the inode-location references on all
> exits. Fast-commit replay can skip the parent update when the directory
> entry no longer matches the target inode, so reserve only the target inode
> in that case.
> 
> The source-derived fault injector reproduced this window by returning EIO
> from the real journal write-access boundary in ext4_reserve_inode_write().
> Before this change, after a normal unmount, e2fsck reported inode 13 as
> unattached, debugfs showed Links: 1, and the parent directory no longer
> contained the file. With this change, the same error is returned before the
> directory entry is changed; the file remains present with Links: 1 and
> e2fsck -fn passes.
> 
> The failure injection and the repaired run were performed on Linux 6.12.1
> with errors=continue and an ordinary sync/unmount; no forced-shutdown ioctl
> was used. The repaired change also builds in the current mainline tree with
> make O=/tmp/linux-mainline-d135ab-build ARCH=x86 W=1 -j8 fs/ext4/namei.o.
> 
> Fixes: 4209ae12b122 ("ext4: handle ext4_mark_inode_dirty errors")
> Cc: stable@vger.kernel.org
> Signed-off-by: Alan <3164729207@qq.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/tencent_D60E766CE07D3A1847B81DE9BC37B4466908@qq.com?part=1


  reply	other threads:[~2026-10-27 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 10:53 [PATCH] ext4: reserve inode write access before unlinking entry Alan
2026-10-27 11:05 ` sashiko-bot [this message]
2026-11-16  7:35 ` Alan
2026-11-16 12:48   ` Jan Kara
2026-11-17  3:39     ` [PATCH v2] " Alan
2026-11-17  3:51       ` sashiko-bot

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-186411@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=3164729207@qq.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