]> git.baikalelectronics.ru Git - kernel.git/commit
block: reopen the device in blkdev_reread_part
authorChristoph Hellwig <hch@lst.de>
Tue, 23 Feb 2021 15:18:22 +0000 (16:18 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 24 Feb 2021 02:23:22 +0000 (19:23 -0700)
commite4dfea926df018d8ab64682d73d0254d3f2aca6b
tree63927d9cad3b0eaef92e46fc3361c57565147ed3
parentdba20dbf6505705c3bf0aa4800a3ce0958ab183d
block: reopen the device in blkdev_reread_part

Historically the BLKRRPART ioctls called into the now defunct ->revalidate
method, which caused the sd driver to check if any media is present.
When the ->revalidate method was removed this revalidation was lost,
leading to lots of I/O errors when using the eject command.  Fix this by
reopening the device to rescan the partitions, and thus calling the
revalidation logic in the sd driver.

Fixes: d87ef709ab5e ("sd: use bdev_check_media_change")
Reported--by: Tom Seewald <tseewald@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Tom Seewald <tseewald@gmail.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/ioctl.c