Subject: Check for device resize when rescanning partitions From: Andrew Patterson Date: Thu Oct 9 08:56:12 2008 +0200: Git: 9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42 References: FATE#302348,FATE#303786 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. Adapted for SLES11, based on the original commit. Signed-off-by: Andrew Patterson Signed-off-by: Jens Axboe Signed-off-by: Hannes Reinecke --- 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 ecc3330..f74d929 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c @@ -480,11 +480,12 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) res = invalidate_partition(disk, 0); if (res) return res; - bdev->bd_invalidated = 0; for (p = 1; p < disk->minors; p++) delete_partition(disk, p); 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 */ -- 1.5.2.4