aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 480f658db6f2..20ca80b7dc20 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -256,8 +256,7 @@ static inline void mddev_unlock(mddev_t * mddev)
256{ 256{
257 up(&mddev->reconfig_sem); 257 up(&mddev->reconfig_sem);
258 258
259 if (mddev->thread) 259 md_wakeup_thread(mddev->thread);
260 md_wakeup_thread(mddev->thread);
261} 260}
262 261
263mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr) 262mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr)
@@ -623,6 +622,7 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
623 mddev->raid_disks = sb->raid_disks; 622 mddev->raid_disks = sb->raid_disks;
624 mddev->size = sb->size; 623 mddev->size = sb->size;
625 mddev->events = md_event(sb); 624 mddev->events = md_event(sb);
625 mddev->bitmap_offset = 0;
626 626
627 if (sb->state & (1<<MD_SB_CLEAN)) 627 if (sb->state & (1<<MD_SB_CLEAN))
628 mddev->recovery_cp = MaxSector; 628 mddev->recovery_cp = MaxSector;
@@ -938,6 +938,7 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
938 mddev->raid_disks = le32_to_cpu(sb->raid_disks); 938 mddev->raid_disks = le32_to_cpu(sb->raid_disks);
939 mddev->size = le64_to_cpu(sb->size)/2; 939 mddev->size = le64_to_cpu(sb->size)/2;
940 mddev->events = le64_to_cpu(sb->events); 940 mddev->events = le64_to_cpu(sb->events);
941 mddev->bitmap_offset = 0;
941 942
942 mddev->recovery_cp = le64_to_cpu(sb->resync_offset); 943 mddev->recovery_cp = le64_to_cpu(sb->resync_offset);
943 memcpy(mddev->uuid, sb->set_uuid, 16); 944 memcpy(mddev->uuid, sb->set_uuid, 16);
@@ -1688,6 +1689,7 @@ static int do_md_run(mddev_t * mddev)
1688 mddev->pers = pers[pnum]; 1689 mddev->pers = pers[pnum];
1689 spin_unlock(&pers_lock); 1690 spin_unlock(&pers_lock);
1690 1691
1692 mddev->recovery = 0;
1691 mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */ 1693 mddev->resync_max_sectors = mddev->size << 1; /* may be over-ridden by personality */
1692 1694
1693 /* before we start the array running, initialise the bitmap */ 1695 /* before we start the array running, initialise the bitmap */
@@ -1712,6 +1714,7 @@ static int do_md_run(mddev_t * mddev)
1712 mddev->in_sync = 1; 1714 mddev->in_sync = 1;
1713 1715
1714 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 1716 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
1717 md_wakeup_thread(mddev->thread);
1715 1718
1716 if (mddev->sb_dirty) 1719 if (mddev->sb_dirty)
1717 md_update_sb(mddev); 1720 md_update_sb(mddev);
@@ -1824,6 +1827,7 @@ static int do_md_stop(mddev_t * mddev, int ro)
1824 fput(mddev->bitmap_file); 1827 fput(mddev->bitmap_file);
1825 mddev->bitmap_file = NULL; 1828 mddev->bitmap_file = NULL;
1826 } 1829 }
1830 mddev->bitmap_offset = 0;
1827 1831
1828 /* 1832 /*
1829 * Free resources if final stop 1833 * Free resources if final stop
@@ -2233,8 +2237,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info)
2233 export_rdev(rdev); 2237 export_rdev(rdev);
2234 2238
2235 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 2239 set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
2236 if (mddev->thread) 2240 md_wakeup_thread(mddev->thread);
2237 md_wakeup_thread(mddev->thread);
2238 return err; 2241 return err;
2239 } 2242 }
2240 2243
@@ -4009,3 +4012,4 @@ EXPORT_SYMBOL(md_print_devices);
4009EXPORT_SYMBOL(md_check_recovery); 4012EXPORT_SYMBOL(md_check_recovery);
4010MODULE_LICENSE("GPL"); 4013MODULE_LICENSE("GPL");
4011MODULE_ALIAS("md"); 4014MODULE_ALIAS("md");
4015MODULE_ALIAS_BLOCKDEV_MAJOR(MD_MAJOR);