block: fix __blkdev_get() for removable devices
authorTejun Heo <tj@kernel.org>
Wed, 5 Nov 2008 09:21:06 +0000 (10:21 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 6 Nov 2008 07:41:56 +0000 (08:41 +0100)
commit89f97496e81d2112b5e41416fe3020688c443818
treee78122150d550bf644ca1a96916a5880823d3e04
parent561920a0d2bb6d63343e83acfd784c0a77bd28d1
block: fix __blkdev_get() for removable devices

Commit 0762b8bde9729f10f8e6249809660ff2ec3ad735 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: Tejun Heo <tj@kernel.org>
Tested-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fs/block_dev.c
This page took 0.025181 seconds and 5 git commands to generate.