From: sashiko-bot@kernel.org
To: "Julian Sun" <sunjunchao@bytedance.com>, linux-ext4@vger.kernel.org
Cc: tytso@mit.edu
Subject: Re: [PATCH v2 6/6] ext4: use atomic bitops for io_end flags
Date: Fri, 23 Oct 2026 06:31:14 +0000 [thread overview]
Message-ID: <sashiko-outbox-182351@kernel.org> (raw)
In-Reply-To: <20261023061851.45579-7-sunjunchao@bytedance.com>
> Before EXT4_IO_END_FAILED was added, the writeback thread set
> EXT4_IO_END_UNWRITTEN and final completion cleared it after the last
> io_end reference was dropped. Adding EXT4_IO_END_FAILED introduced a
> concurrent writer in failed-bio completion. Successful bio completions
> do not update the flags.
>
> An io_end can cover already-mapped folios submitted before a later
> unwritten extent is mapped. An earlier bio can fail while writeback
> first sets UNWRITTEN. The non-atomic updates can then lose a bit:
>
> Bio completion Writeback thread
> -------------- ----------------
> read flag = 0
> attach reserved handle to io_end
> flag |= UNWRITTEN
> [ ... ]
> Use atomic bit operations to fix the race.
>
> Fixes: e856f93e0fb2 ("ext4: do not convert the unwritten extents if data writeback fails")
> Cc: stable@vger.kernel.org
> Signed-off-by: Julian Sun <sunjunchao@bytedance.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261023061851.45579-1-sunjunchao@bytedance.com?part=6
prev parent reply other threads:[~2026-10-23 6:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 6:18 [PATCH v2 0/6] ext4: fix buffered writeback error handling Julian Sun
2026-10-23 6:18 ` [PATCH v2 1/6] ext4: move extent mapping error handling out of the loop Julian Sun
2026-10-23 6:27 ` sashiko-bot
2026-10-23 6:18 ` [PATCH v2 2/6] ext4: submit mapped buffers when io_end_vec allocation fails Julian Sun
2026-10-23 6:33 ` sashiko-bot
2026-10-23 6:18 ` [PATCH v2 3/6] ext4: prevent stale data exposure after fatal mapping errors Julian Sun
2026-10-23 6:18 ` [PATCH v2 4/6] ext4: put folio on partial writeback validation failure Julian Sun
2026-10-23 6:28 ` sashiko-bot
2026-10-23 6:18 ` [PATCH v2 5/6] ext4: report unwritten extent conversion errors to fsync Julian Sun
2026-10-23 6:26 ` sashiko-bot
2026-10-23 6:18 ` [PATCH v2 6/6] ext4: use atomic bitops for io_end flags Julian Sun
2026-10-23 6:31 ` 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-182351@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sunjunchao@bytedance.com \
--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