summaryrefslogtreecommitdiff
path: root/fs/partitions
diff options
context:
space:
mode:
authorAndrew Patterson <andrew.patterson@hp.com>2008-09-04 14:27:30 -0600
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 08:56:12 +0200
commit9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42 (patch)
treec6f4ffdb3351a379fc5aee8fd6f91ba6caee83d0 /fs/partitions
parentc3279d1454cdfed02a557d789d8a6d08ab4cbe70 (diff)
downloadlinux-3.10-9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42.tar.gz
linux-3.10-9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42.tar.bz2
linux-3.10-9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42.zip
Check for device resize when rescanning partitions
Check for device resize in the rescan_partitions() routine. If the device has been resized, the bdev size is set to match. The rescan_partitions() routine is called when opening the device and when calling the BLKRRPART ioctl. Signed-off-by: Andrew Patterson <andrew.patterson@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/check.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 0e411603fdf..7408227c49c 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -504,7 +504,6 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
res = invalidate_partition(disk, 0);
if (res)
return res;
- bdev->bd_invalidated = 0;
disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY);
while ((part = disk_part_iter_next(&piter)))
@@ -513,6 +512,8 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
if (disk->fops->revalidate_disk)
disk->fops->revalidate_disk(disk);
+ check_disk_size_change(disk, bdev);
+ bdev->bd_invalidated = 0;
if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
return 0;
if (IS_ERR(state)) /* I/O error reading the partition table */