Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83596
b: refs/heads/master
c: 1ec4a93
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Feb 6, 2008
1 parent 8ccac71 commit 96dbc71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c620727779f7cc8ea96efb71f0651a26349e59c1
refs/heads/master: 1ec4a9398dc05061b6258061676fede733458893
9 changes: 6 additions & 3 deletions trunk/drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev)
mddev->major_version = 0;
mddev->minor_version = sb->minor_version;
mddev->patch_version = sb->patch_version;
mddev->persistent = 1;
mddev->external = 0;
mddev->chunk_size = sb->chunk_size;
mddev->ctime = sb->ctime;
Expand Down Expand Up @@ -1159,7 +1158,6 @@ static int super_1_validate(mddev_t *mddev, mdk_rdev_t *rdev)
if (mddev->raid_disks == 0) {
mddev->major_version = 1;
mddev->patch_version = 0;
mddev->persistent = 1;
mddev->external = 0;
mddev->chunk_size = le32_to_cpu(sb->chunksize) << 9;
mddev->ctime = le64_to_cpu(sb->ctime) & ((1ULL << 32)-1);
Expand Down Expand Up @@ -3213,8 +3211,11 @@ static int do_md_run(mddev_t * mddev)
/*
* Analyze all RAID superblock(s)
*/
if (!mddev->raid_disks)
if (!mddev->raid_disks) {
if (!mddev->persistent)
return -EINVAL;
analyze_sbs(mddev);
}

chunk_size = mddev->chunk_size;

Expand Down Expand Up @@ -3621,6 +3622,7 @@ static int do_md_stop(mddev_t * mddev, int mode)
mddev->resync_max = MaxSector;
mddev->reshape_position = MaxSector;
mddev->external = 0;
mddev->persistent = 0;

} else if (mddev->pers)
printk(KERN_INFO "md: %s switched to read-only mode.\n",
Expand Down Expand Up @@ -3729,6 +3731,7 @@ static void autorun_devices(int part)
mddev_unlock(mddev);
} else {
printk(KERN_INFO "md: created %s\n", mdname(mddev));
mddev->persistent = 1;
ITERATE_RDEV_GENERIC(candidates,rdev,tmp) {
list_del_init(&rdev->same_set);
if (bind_rdev_to_array(rdev, mddev))
Expand Down

0 comments on commit 96dbc71

Please sign in to comment.