diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 7145cd150f7b..653d4dcbee23 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -1161,6 +1161,9 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) | |||
1161 | 1161 | ||
1162 | sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors); | 1162 | sb->cnt_corrected_read = atomic_read(&rdev->corrected_errors); |
1163 | 1163 | ||
1164 | sb->raid_disks = cpu_to_le32(mddev->raid_disks); | ||
1165 | sb->size = cpu_to_le64(mddev->size); | ||
1166 | |||
1164 | if (mddev->bitmap && mddev->bitmap_file == NULL) { | 1167 | if (mddev->bitmap && mddev->bitmap_file == NULL) { |
1165 | sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset); | 1168 | sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_offset); |
1166 | sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); | 1169 | sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); |
@@ -2686,14 +2689,6 @@ static int do_md_stop(mddev_t * mddev, int ro) | |||
2686 | set_disk_ro(disk, 1); | 2689 | set_disk_ro(disk, 1); |
2687 | } | 2690 | } |
2688 | 2691 | ||
2689 | bitmap_destroy(mddev); | ||
2690 | if (mddev->bitmap_file) { | ||
2691 | atomic_set(&mddev->bitmap_file->f_dentry->d_inode->i_writecount, 1); | ||
2692 | fput(mddev->bitmap_file); | ||
2693 | mddev->bitmap_file = NULL; | ||
2694 | } | ||
2695 | mddev->bitmap_offset = 0; | ||
2696 | |||
2697 | /* | 2692 | /* |
2698 | * Free resources if final stop | 2693 | * Free resources if final stop |
2699 | */ | 2694 | */ |
@@ -2703,6 +2698,14 @@ static int do_md_stop(mddev_t * mddev, int ro) | |||
2703 | struct gendisk *disk; | 2698 | struct gendisk *disk; |
2704 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); | 2699 | printk(KERN_INFO "md: %s stopped.\n", mdname(mddev)); |
2705 | 2700 | ||
2701 | bitmap_destroy(mddev); | ||
2702 | if (mddev->bitmap_file) { | ||
2703 | atomic_set(&mddev->bitmap_file->f_dentry->d_inode->i_writecount, 1); | ||
2704 | fput(mddev->bitmap_file); | ||
2705 | mddev->bitmap_file = NULL; | ||
2706 | } | ||
2707 | mddev->bitmap_offset = 0; | ||
2708 | |||
2706 | ITERATE_RDEV(mddev,rdev,tmp) | 2709 | ITERATE_RDEV(mddev,rdev,tmp) |
2707 | if (rdev->raid_disk >= 0) { | 2710 | if (rdev->raid_disk >= 0) { |
2708 | char nm[20]; | 2711 | char nm[20]; |
@@ -3465,7 +3468,7 @@ static int update_size(mddev_t *mddev, unsigned long size) | |||
3465 | bdev = bdget_disk(mddev->gendisk, 0); | 3468 | bdev = bdget_disk(mddev->gendisk, 0); |
3466 | if (bdev) { | 3469 | if (bdev) { |
3467 | mutex_lock(&bdev->bd_inode->i_mutex); | 3470 | mutex_lock(&bdev->bd_inode->i_mutex); |
3468 | i_size_write(bdev->bd_inode, mddev->array_size << 10); | 3471 | i_size_write(bdev->bd_inode, (loff_t)mddev->array_size << 10); |
3469 | mutex_unlock(&bdev->bd_inode->i_mutex); | 3472 | mutex_unlock(&bdev->bd_inode->i_mutex); |
3470 | bdput(bdev); | 3473 | bdput(bdev); |
3471 | } | 3474 | } |
@@ -3485,17 +3488,6 @@ static int update_raid_disks(mddev_t *mddev, int raid_disks) | |||
3485 | if (mddev->sync_thread) | 3488 | if (mddev->sync_thread) |
3486 | return -EBUSY; | 3489 | return -EBUSY; |
3487 | rv = mddev->pers->reshape(mddev, raid_disks); | 3490 | rv = mddev->pers->reshape(mddev, raid_disks); |
3488 | if (!rv) { | ||
3489 | struct block_device *bdev; | ||
3490 | |||
3491 | bdev = bdget_disk(mddev->gendisk, 0); | ||
3492 | if (bdev) { | ||
3493 | mutex_lock(&bdev->bd_inode->i_mutex); | ||
3494 | i_size_write(bdev->bd_inode, mddev->array_size << 10); | ||
3495 | mutex_unlock(&bdev->bd_inode->i_mutex); | ||
3496 | bdput(bdev); | ||
3497 | } | ||
3498 | } | ||
3499 | return rv; | 3491 | return rv; |
3500 | } | 3492 | } |
3501 | 3493 | ||