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: NTejun Heo <tj@kernel.org> Tested-by: NBorislav Petkov <petkovbb@gmail.com> Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
Showing
想要评论请 注册 或 登录