From: David Sterba <dsterba@suse.cz>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
Naohiro Aota <Naohiro.Aota@wdc.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] btrfs: fix and document the zoned device choice in alloc_new_bio
Date: Mon, 28 Mar 2022 21:12:40 +0200 [thread overview]
Message-ID: <20220328191240.GT2237@twin.jikos.cz> (raw)
In-Reply-To: <PH0PR04MB7416CF5DB1670FF12D823D779B1A9@PH0PR04MB7416.namprd04.prod.outlook.com>
On Fri, Mar 25, 2022 at 09:09:56AM +0000, Johannes Thumshirn wrote:
> On 24/03/2022 17:54, Christoph Hellwig wrote:
> > Zone Append bios only need a valid block device in struct bio, but
> > not the device in the btrfs_bio. Use the information from
> > btrfs_zoned_get_device to set up bi_bdev and fix zoned writes on
> > multi-device file system with non-homogeneous capabilities and remove
> > the pointless btrfs_bio.device assignment.
> >
> > Add big fat comments explaining what is going on here.
>
> Looks like the old code worked by sheer luck, as we had wbc set and thus
> always assigned fs_info->fs_devices->latest_dev->bdev to the bio. Which
> would obviously not work on a multi device FS.
No, it worked fine because the real bio is set just before writing the
data somewhere deep in the io submit path in submit_stripe_bio().
That it has to be set here is because of the cgroup implementation that
accesses it, see 429aebc0a9a0 ("btrfs: get bdev directly from fs_devices
in submit_extent_page").
Which brings me to the question if Christoph's fix is correct because
the comment for the wbc + zoned append is assuming something that's not
true.
next prev parent reply other threads:[~2022-03-28 19:16 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 16:52 btrfs zoned fixlets Christoph Hellwig
2022-03-24 16:52 ` [PATCH 1/2] btrfs: remove the zoned/zone_size union in struct btrfs_fs_info Christoph Hellwig
2022-03-25 7:33 ` Johannes Thumshirn
2022-03-28 14:37 ` David Sterba
2022-03-28 12:46 ` Naohiro Aota
2022-03-28 19:01 ` David Sterba
2022-03-24 16:52 ` [PATCH 2/2] btrfs: fix and document the zoned device choice in alloc_new_bio Christoph Hellwig
2022-03-25 9:09 ` Johannes Thumshirn
2022-03-28 19:12 ` David Sterba [this message]
2022-03-28 23:04 ` Naohiro Aota
2022-03-30 15:10 ` David Sterba
2022-03-28 13:31 ` Naohiro Aota
2022-03-25 7:35 ` btrfs zoned fixlets Johannes Thumshirn
2022-03-25 7:50 ` Christoph Hellwig
2022-04-08 16:41 ` Christoph Hellwig
2022-04-08 16:50 ` David Sterba
2022-04-11 16:39 ` David Sterba
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=20220328191240.GT2237@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=Johannes.Thumshirn@wdc.com \
--cc=Naohiro.Aota@wdc.com \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
/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