diff options
author | Andrew Patterson <andrew.patterson@hp.com> | 2008-09-04 16:27:30 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:12 -0400 |
commit | 9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42 (patch) | |
tree | c6f4ffdb3351a379fc5aee8fd6f91ba6caee83d0 /fs | |
parent | c3279d1454cdfed02a557d789d8a6d08ab4cbe70 (diff) |
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')
-rw-r--r-- | fs/partitions/check.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 0e411603fdf5..7408227c49c9 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) | |||
504 | res = invalidate_partition(disk, 0); | 504 | res = invalidate_partition(disk, 0); |
505 | if (res) | 505 | if (res) |
506 | return res; | 506 | return res; |
507 | bdev->bd_invalidated = 0; | ||
508 | 507 | ||
509 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY); | 508 | disk_part_iter_init(&piter, disk, DISK_PITER_INCL_EMPTY); |
510 | while ((part = disk_part_iter_next(&piter))) | 509 | while ((part = disk_part_iter_next(&piter))) |
@@ -513,6 +512,8 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) | |||
513 | 512 | ||
514 | if (disk->fops->revalidate_disk) | 513 | if (disk->fops->revalidate_disk) |
515 | disk->fops->revalidate_disk(disk); | 514 | disk->fops->revalidate_disk(disk); |
515 | check_disk_size_change(disk, bdev); | ||
516 | bdev->bd_invalidated = 0; | ||
516 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) | 517 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) |
517 | return 0; | 518 | return 0; |
518 | if (IS_ERR(state)) /* I/O error reading the partition table */ | 519 | if (IS_ERR(state)) /* I/O error reading the partition table */ |