block: move bd_set_size() above rescan_partitions() in __blkdev_get()
authorTejun Heo <tj@kernel.org>
Mon, 23 May 2011 11:26:07 +0000 (13:26 +0200)
committerSteve Conklin <sconklin@canonical.com>
Fri, 15 Jul 2011 17:20:50 +0000 (12:20 -0500)
commit6c1103510481b2e72812dd97eaff04ca602eca31
tree0fdb8bd1d852c46f66b08c00d0c509d1901adb4a
parent1e929d2534e96286ccde24c0eb4afcd00aa05d75
block: move bd_set_size() above rescan_partitions() in __blkdev_get()

BugLink: http://bugs.launchpad.net/bugs/793702

commit 7e69723fef8771a9d57bd27d36281d756130b4b5 upstream.

02e352287a4 (block: rescan partitions on invalidated devices on
-ENOMEDIA too) relocated partition rescan above explicit bd_set_size()
to simplify condition check.  As rescan_partitions() does its own bdev
size setting, this doesn't break anything; however,
rescan_partitions() prints out the following messages when adjusting
bdev size, which can be confusing.

  sda: detected capacity change from 0 to 146815737856
  sdb: detected capacity change from 0 to 146815737856

This patch restores the original order and remove the warning
messages.

stable: Please apply together with 02e352287a4 (block: rescan
        partitions on invalidated devices on -ENOMEDIA too).

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Tony Luck <tony.luck@gmail.com>
Tested-by: Tony Luck <tony.luck@gmail.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
fs/block_dev.c