]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.drivers/bdev-resize-check-for-device-resize
Revert "Move xen patchset to new version's subdir."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.drivers / bdev-resize-check-for-device-resize
CommitLineData
00e5a55c
BS
1Subject: Check for device resize when rescanning partitions
2From: Andrew Patterson <andrew.patterson@hp.com>
3Date: Thu Oct 9 08:56:12 2008 +0200:
4Git: 9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42
5References: FATE#302348,FATE#303786
6
7Check for device resize in the rescan_partitions() routine. If the device
8has been resized, the bdev size is set to match. The rescan_partitions()
9routine is called when opening the device and when calling the
10BLKRRPART ioctl.
11
12Adapted for SLES11, based on the original commit.
13
14Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
15Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16Signed-off-by: Hannes Reinecke <hare@suse.de>
17---
18 fs/partitions/check.c | 3 ++-
19 1 files changed, 2 insertions(+), 1 deletions(-)
20
21diff --git a/fs/partitions/check.c b/fs/partitions/check.c
22index ecc3330..f74d929 100644
23--- a/fs/partitions/check.c
24+++ b/fs/partitions/check.c
25@@ -480,11 +480,12 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
26 res = invalidate_partition(disk, 0);
27 if (res)
28 return res;
29- bdev->bd_invalidated = 0;
30 for (p = 1; p < disk->minors; p++)
31 delete_partition(disk, p);
32 if (disk->fops->revalidate_disk)
33 disk->fops->revalidate_disk(disk);
34+ check_disk_size_change(disk, bdev);
35+ bdev->bd_invalidated = 0;
36 if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
37 return 0;
38 if (IS_ERR(state)) /* I/O error reading the partition table */
39--
401.5.2.4
41