Skip to content
Commit 89f97496 authored by Tejun Heo's avatar Tejun Heo Committed by Jens Axboe
Browse files

block: fix __blkdev_get() for removable devices

Commit 0762b8bd

 moved disk_get_part()
in front of recursive get on the whole disk, which caused removable
devices to try disk_get_part() before rescanning after a new media is
inserted, which might fail legit open attempts or give the old
partition.

This patch fixes the problem by moving disk_get_part() after
__blkdev_get() on the whole disk.

This problem was spotted by Borislav Petkov.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Tested-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 561920a0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment