From: Ming Lei <ming.lei@redhat.com>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Stephen Zhang <starzhangzsd@gmail.com>,
linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
nvdimm@lists.linux.dev, virtualization@lists.linux.dev,
linux-nvme@lists.infradead.org, gfs2@lists.linux.dev,
ntfs3@lists.linux.dev, linux-xfs@vger.kernel.org,
zhangshida@kylinos.cn, Coly Li <colyli@fnnas.com>,
linux-bcache@vger.kernel.org
Subject: Re: Fix potential data loss and corruption due to Incorrect BIO Chain Handling
Date: Sun, 23 Nov 2025 21:48:56 +0800 [thread overview]
Message-ID: <aSMQyCJrqbIromUd@fedora> (raw)
In-Reply-To: <CAHc6FU7+riVQBX7L2uk64A355rF+DfQ6xhP425ruQ76d_SDPGA@mail.gmail.com>
On Sat, Nov 22, 2025 at 03:56:58PM +0100, Andreas Gruenbacher wrote:
> On Sat, Nov 22, 2025 at 1:07 PM Ming Lei <ming.lei@redhat.com> wrote:
> > > static void bio_chain_endio(struct bio *bio)
> > > {
> > > bio_endio(__bio_chain_endio(bio));
> > > }
> >
> > bio_chain_endio() never gets called really, which can be thought as `flag`,
>
> That's probably where this stops being relevant for the problem
> reported by Stephen Zhang.
>
> > and it should have been defined as `WARN_ON_ONCE(1);` for not confusing people.
>
> But shouldn't bio_chain_endio() still be fixed to do the right thing
> if called directly, or alternatively, just BUG()? Warning and still
> doing the wrong thing seems a bit bizarre.
IMO calling ->bi_end_io() directly shouldn't be encouraged.
The only in-tree direct call user could be bcache, so is this reported
issue triggered on bcache?
If bcache can't call bio_endio(), I think it is fine to fix
bio_chain_endio().
>
> I also see direct bi_end_io calls in erofs_fileio_ki_complete(),
> erofs_fscache_bio_endio(), and erofs_fscache_submit_bio(), so those
> are at least confusing.
All looks FS bio(non-chained), so bio_chain_endio() shouldn't be involved
in erofs code base.
Thanks,
Ming
next prev parent reply other threads:[~2025-11-23 13:49 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-21 8:17 Fix potential data loss and corruption due to Incorrect BIO Chain Handling zhangshida
2025-11-21 8:17 ` [PATCH 1/9] block: fix data loss and stale date exposure problems during append write zhangshida
2025-11-21 9:34 ` Johannes Thumshirn
2025-11-22 7:08 ` Stephen Zhang
2025-11-21 10:31 ` Christoph Hellwig
2025-11-21 16:13 ` Andreas Gruenbacher
2025-11-22 7:25 ` Stephen Zhang
2025-11-28 3:22 ` Stephen Zhang
2025-11-28 5:55 ` Christoph Hellwig
2025-11-28 6:26 ` Stephen Zhang
2025-11-22 12:15 ` Ming Lei
2025-11-21 8:17 ` [PATCH 2/9] block: export bio_chain_and_submit zhangshida
2025-11-21 10:32 ` Christoph Hellwig
2025-11-21 17:12 ` Andreas Gruenbacher
2025-11-22 7:02 ` Stephen Zhang
2025-11-21 8:17 ` [PATCH 3/9] gfs2: use bio_chain_and_submit for simplification zhangshida
2025-11-21 8:17 ` [PATCH 4/9] xfs: " zhangshida
2025-11-21 8:17 ` [PATCH 5/9] block: " zhangshida
2025-11-21 8:17 ` [PATCH 6/9] fs/ntfs3: " zhangshida
2025-11-21 8:17 ` [PATCH 7/9] zram: " zhangshida
2025-11-21 8:17 ` [PATCH 8/9] nvmet: fix the potential bug and " zhangshida
2025-11-21 8:17 ` [PATCH 9/9] nvdimm: " zhangshida
2025-11-21 10:37 ` Fix potential data loss and corruption due to Incorrect BIO Chain Handling Christoph Hellwig
2025-11-22 6:38 ` Stephen Zhang
2025-11-24 6:22 ` Christoph Hellwig
2025-11-27 7:05 ` Stephen Zhang
2025-11-27 7:14 ` Christoph Hellwig
2025-11-27 7:40 ` Gao Xiang
2025-11-27 14:46 ` Christoph Hellwig
2025-11-28 1:32 ` Stephen Zhang
2025-11-28 1:29 ` Stephen Zhang
2025-11-22 3:35 ` Ming Lei
2025-11-22 6:42 ` Stephen Zhang
2025-11-22 7:46 ` Andreas Gruenbacher
2025-11-22 12:01 ` Ming Lei
2025-11-22 14:56 ` Andreas Gruenbacher
2025-11-23 3:14 ` Stephen Zhang
2025-11-23 13:48 ` Ming Lei [this message]
2025-11-24 1:28 ` Stephen Zhang
2025-11-24 2:00 ` Stephen Zhang
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=aSMQyCJrqbIromUd@fedora \
--to=ming.lei@redhat.com \
--cc=agruenba@redhat.com \
--cc=colyli@fnnas.com \
--cc=gfs2@lists.linux.dev \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ntfs3@lists.linux.dev \
--cc=nvdimm@lists.linux.dev \
--cc=starzhangzsd@gmail.com \
--cc=virtualization@lists.linux.dev \
--cc=zhangshida@kylinos.cn \
/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;
as well as URLs for NNTP newsgroup(s).