linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hch <hch@lst.de>
To: Naohiro Aota <Naohiro.Aota@wdc.com>
Cc: hch <hch@lst.de>, Qu Wenruo <quwenruo.btrfs@gmx.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	WenRuo Qu <wqu@suse.com>
Subject: Re: [PATCH] btrfs: fix error propagation of split bios
Date: Thu, 10 Oct 2024 11:45:00 +0200	[thread overview]
Message-ID: <20241010094500.GA10100@lst.de> (raw)
In-Reply-To: <zwr4zs6gggixecwyapy7ghay4bjp3tsekqgzj3gswxmfn5dwyq@cu757ssku4p6>

On Thu, Oct 10, 2024 at 08:53:52AM +0000, Naohiro Aota wrote:
> Things can screw up here. If the btrfs_bio_end_io() for a "split clone"
> btrfs_bio is called fast enough (or immediately in case of dm-error), the
> "split original" btrfs_bio is not yet submitted. Thus, its private data,
> which is setup in btrfs_submit_mirrored_bio(), is not yet have a proper
> value. So, reading orig_bbio->bio.bi_private returns NULL, and accessing
> its max_errors results in NULL pointer dereference.

Ok, thanks.  So yes, the cmpxchg based version of this should be fine.


  reply	other threads:[~2024-10-10  9:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09 15:57 [PATCH] btrfs: fix error propagation of split bios Naohiro Aota
2024-10-09 16:59 ` David Sterba
2024-10-10  5:51   ` Naohiro Aota
2024-10-10 11:02     ` David Sterba
2024-10-09 21:38 ` Qu Wenruo
2024-10-09 21:40   ` Qu Wenruo
2024-10-09 21:58   ` Qu Wenruo
2024-10-09 23:11     ` Qu Wenruo
2024-10-10  7:06       ` Christoph Hellwig
2024-10-10  8:53         ` Naohiro Aota
2024-10-10  9:45           ` hch [this message]
2024-10-12  6:12 ` kernel test robot

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=20241010094500.GA10100@lst.de \
    --to=hch@lst.de \
    --cc=Naohiro.Aota@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.com \
    --cc=wqu@suse.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;
as well as URLs for NNTP newsgroup(s).