summaryrefslogtreecommitdiffstats
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2023-06-22 18:46:55 +0200
committerJens Axboe <axboe@kernel.dk>2023-06-23 16:10:04 -0600
commit2c5555983bd27d24162534b682b10654639a5576 (patch)
tree5a533d92605c6cb6610b363fb293858d044ca783 /block/blk-throttle.c
parentabcc0cbd49283fccd20420e86416b2475b00819c (diff)
downloadlinux-2c5555983bd27d24162534b682b10654639a5576.tar.gz
linux-2c5555983bd27d24162534b682b10654639a5576.tar.bz2
linux-2c5555983bd27d24162534b682b10654639a5576.zip
bcache: Fix bcache device claiming
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. 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 broken by commit 29499ab060fe ("bcache: don't pass a stack address to blkdev_get_by_path"). Fixes: 2736e8eeb0cc ("block: use the holder as indication for exclusive opens") Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev> Acked-by: Coly Li <colyli@suse.de> Link: https://lore.kernel.org/r/20230622164658.12861-2-jack@suse.cz Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-throttle.c')
0 files changed, 0 insertions, 0 deletions