]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.drivers/bdev-resize-check-for-device-resize
Revert "Disable build of xen kernel."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.drivers / bdev-resize-check-for-device-resize
1 Subject: Check for device resize when rescanning partitions
2 From: Andrew Patterson <andrew.patterson@hp.com>
3 Date: Thu Oct 9 08:56:12 2008 +0200:
4 Git: 9bc3ffbfbdf71fefda8a261ef8d6fdc388a29b42
5 References: FATE#302348,FATE#303786
6
7 Check for device resize in the rescan_partitions() routine. If the device
8 has been resized, the bdev size is set to match. The rescan_partitions()
9 routine is called when opening the device and when calling the
10 BLKRRPART ioctl.
11
12 Adapted for SLES11, based on the original commit.
13
14 Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
15 Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
16 Signed-off-by: Hannes Reinecke <hare@suse.de>
17 ---
18 fs/partitions/check.c | 3 ++-
19 1 files changed, 2 insertions(+), 1 deletions(-)
20
21 diff --git a/fs/partitions/check.c b/fs/partitions/check.c
22 index 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 --
40 1.5.2.4
41