From: Christoph Hellwig <hch@infradead.org>
To: Jan Kara <jack@suse.cz>
Cc: Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@infradead.org>,
linux-block@vger.kernel.org, Coly Li <colyli@suse.de>,
linux-bcache@vger.kernel.org
Subject: Re: [PATCH 2/2] bcache: Fix bcache device claiming
Date: Thu, 22 Jun 2023 08:12:29 -0700 [thread overview]
Message-ID: <ZJRk3Y8LjGhEKqK6@infradead.org> (raw)
In-Reply-To: <20230621162333.30027-2-jack@suse.cz>
On Wed, Jun 21, 2023 at 06:23:27PM +0200, Jan Kara wrote:
> Commit 2736e8eeb0cc ("block: use the holder as indication for exclusive
> opens") introduced a change that blkdev_put() has to get exclusive
> holder of the bdev as an argument. However it overlooked that
> register_bdev() and register_cache() overwrite the bdev->bd_holder field
> in the block device to point to the real owning object which was not
> available at the time we called blkdev_get_by_path(). Messing with bdev
> internals like this is a layering violation and it also causes
> blkdev_put() to issue warning about mismatching holders.
Ugg, yes.
> Fix bcache to reopen the block device with appropriate holder once it is
> available which also restores the behavior that multiple bcache caches
> cannot claim the same device which was also broken by commit
> 2736e8eeb0cc.
That was actually an intentional and documented change in commit
29499ab060fe ("bcache: don't pass a stack address to
blkdev_get_by_path") because the old behavior was broken already in
addition to the changing of the block stuff underneath. Not that I'm
arguing against your changes here, but the commit log probably needs a
bit of tweaking.
prev parent reply other threads:[~2023-06-22 15:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 16:23 [PATCH 0/2] bcache: Fix block device claiming Jan Kara
2023-06-21 16:23 ` [PATCH 1/2] bcache: Alloc holder object before async registration Jan Kara
2023-06-21 17:56 ` Kent Overstreet
2023-06-22 10:09 ` Jan Kara
2023-06-22 12:05 ` Kent Overstreet
2023-06-22 15:14 ` Christoph Hellwig
2023-06-21 16:23 ` [PATCH 2/2] bcache: Fix bcache device claiming Jan Kara
2023-06-22 1:23 ` kernel test robot
2023-06-22 10:26 ` Jan Kara
2023-06-22 1:44 ` kernel test robot
2023-06-22 3:29 ` kernel test robot
2023-06-22 15:12 ` Christoph Hellwig [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=ZJRk3Y8LjGhEKqK6@infradead.org \
--to=hch@infradead.org \
--cc=axboe@kernel.dk \
--cc=colyli@suse.de \
--cc=jack@suse.cz \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@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;
as well as URLs for NNTP newsgroup(s).