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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 79eb63fdb4b3..78fe3e97ff99 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -779,7 +779,6 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
779 mddev->major_version = 0; 779 mddev->major_version = 0;
780 mddev->minor_version = sb->minor_version; 780 mddev->minor_version = sb->minor_version;
781 mddev->patch_version = sb->patch_version; 781 mddev->patch_version = sb->patch_version;
782 mddev->persistent = 1;
783 mddev->external = 0; 782 mddev->external = 0;
784 mddev->chunk_size = sb->chunk_size; 783 mddev->chunk_size = sb->chunk_size;
785 mddev->ctime = sb->ctime; 784 mddev->ctime = sb->ctime;
@@ -1159,7 +1158,6 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
1159 if (mddev->raid_disks == 0) { 1158 if (mddev->raid_disks == 0) {
1160 mddev->major_version = 1; 1159 mddev->major_version = 1;
1161 mddev->patch_version = 0; 1160 mddev->patch_version = 0;
1162 mddev->persistent = 1;
1163 mddev->external = 0; 1161 mddev->external = 0;
1164 mddev->chunk_size = le32_to_cpu(sb->chunksize) << 9; 1162 mddev->chunk_size = le32_to_cpu(sb->chunksize) << 9;
1165 mddev->ctime = le64_to_cpu(sb->ctime) & ((1ULL << 32)-1); 1163 mddev->ctime = le64_to_cpu(sb->ctime) & ((1ULL << 32)-1);
@@ -3213,8 +3211,11 @@ static int do_md_run(mddev_t * mddev)
3213 /* 3211 /*
3214 * Analyze all RAID superblock(s) 3212 * Analyze all RAID superblock(s)
3215 */ 3213 */
3216 if (!mddev->raid_disks) 3214 if (!mddev->raid_disks) {
3215 if (!mddev->persistent)
3216 return -EINVAL;
3217 analyze_sbs(mddev); 3217 analyze_sbs(mddev);
3218 }
3218 3219
3219 chunk_size = mddev->chunk_size; 3220 chunk_size = mddev->chunk_size;
3220 3221
@@ -3621,6 +3622,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
3621 mddev->resync_max = MaxSector; 3622 mddev->resync_max = MaxSector;
3622 mddev->reshape_position = MaxSector; 3623 mddev->reshape_position = MaxSector;
3623 mddev->external = 0; 3624 mddev->external = 0;
3625 mddev->persistent = 0;
3624 3626
3625 } else if (mddev->pers) 3627 } else if (mddev->pers)
3626 printk(KERN_INFO "md: %s switched to read-only mode.\n", 3628 printk(KERN_INFO "md: %s switched to read-only mode.\n",
@@ -3729,6 +3731,7 @@ static void autorun_devices(int part)
3729 mddev_unlock(mddev); 3731 mddev_unlock(mddev);
3730 } else { 3732 } else {
3731 printk(KERN_INFO "md: created %s\n", mdname(mddev)); 3733 printk(KERN_INFO "md: created %s\n", mdname(mddev));
3734 mddev->persistent = 1;
3732 ITERATE_RDEV_GENERIC(candidates,rdev,tmp) { 3735 ITERATE_RDEV_GENERIC(candidates,rdev,tmp) {
3733 list_del_init(&rdev->same_set); 3736 list_del_init(&rdev->same_set);
3734 if (bind_rdev_to_array(rdev, mddev)) 3737 if (bind_rdev_to_array(rdev, mddev))