]> git.baikalelectronics.ru Git - kernel.git/commit
xen-blkfront: sanitize the removal state machine
authorChristoph Hellwig <hch@lst.de>
Thu, 15 Jul 2021 14:17:11 +0000 (16:17 +0200)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Jul 2021 15:32:34 +0000 (09:32 -0600)
commit1d52cf899e7fae9e5cc72a35bc70b251b75fbb7a
tree67cb04462645bc180be976d23a745d2e8c15831e
parent090118539327edda6eea7441f46bc022bc49425a
xen-blkfront: sanitize the removal state machine

xen-blkfront has a weird protocol where close message from the remote
side can be delayed, and where hot removals are treated somewhat
differently from regular removals, all leading to potential NULL
pointer removals, and a del_gendisk from the block device release
method, which will deadlock. Fix this by just performing normal hot
removals even when the device is opened like all other Linux block
drivers.

Fixes: 4a92cb3acc41 ("block: take bd_mutex around delete_partitions in del_gendisk")
Reported-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20210715141711.1257293-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/xen-blkfront.c