[PATCH 3/6] Check for device resize when rescanning partitions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Patterson
Date: Friday, August 29, 2008 - 4:13 pm

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>
---

 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 7d6b34e..2e7b1fa 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 */

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] detect online disk resize, Andrew Patterson, (Fri Aug 29, 4:12 pm)
[PATCH 1/6] Wrapper for lower-level revalidate_disk routines., Andrew Patterson, (Fri Aug 29, 4:13 pm)
[PATCH 3/6] Check for device resize when rescanning partitions, Andrew Patterson, (Fri Aug 29, 4:13 pm)
[PATCH 4/6] SCSI sd driver calls revalidate_disk wrapper., Andrew Patterson, (Fri Aug 29, 4:13 pm)
Re: [PATCH 0/6] detect online disk resize, Jens Axboe, (Thu Sep 4, 12:26 am)
Re: [PATCH 0/6] detect online disk resize, Andrew Patterson, (Thu Sep 4, 7:25 am)
Re: [PATCH 0/6] detect online disk resize, Jeff Moyer, (Mon Sep 8, 11:01 am)
Re: [PATCH 0/6] detect online disk resize, Pasi , (Tue Sep 9, 12:41 am)
Re: [PATCH 0/6] detect online disk resize, Vladislav Bolkhovitin, (Wed Sep 24, 8:23 am)