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.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 07ab6790e29d..117ea5fde568 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2633,9 +2633,9 @@ layout_store(mddev_t *mddev, const char *buf, size_t len)
2633 2633
2634 if (mddev->pers) 2634 if (mddev->pers)
2635 return -EBUSY; 2635 return -EBUSY;
2636 if (mddev->reshape_position != MaxSector) 2636
2637 mddev->new_layout = n; 2637 mddev->new_layout = n;
2638 else 2638 if (mddev->reshape_position == MaxSector)
2639 mddev->layout = n; 2639 mddev->layout = n;
2640 return len; 2640 return len;
2641} 2641}
@@ -2702,9 +2702,9 @@ chunk_size_store(mddev_t *mddev, const char *buf, size_t len)
2702 2702
2703 if (mddev->pers) 2703 if (mddev->pers)
2704 return -EBUSY; 2704 return -EBUSY;
2705 else if (mddev->reshape_position != MaxSector) 2705
2706 mddev->new_chunk = n; 2706 mddev->new_chunk = n;
2707 else 2707 if (mddev->reshape_position == MaxSector)
2708 mddev->chunk_size = n; 2708 mddev->chunk_size = n;
2709 return len; 2709 return len;
2710} 2710}
@@ -3831,7 +3831,10 @@ static int do_md_run(mddev_t * mddev)
3831 } 3831 }
3832 mddev->pers = pers; 3832 mddev->pers = pers;
3833 spin_unlock(&pers_lock); 3833 spin_unlock(&pers_lock);
3834 mddev->level = pers->level; 3834 if (mddev->level != pers->level) {
3835 mddev->level = pers->level;
3836 mddev->new_level = pers->level;
3837 }
3835 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel)); 3838 strlcpy(mddev->clevel, pers->name, sizeof(mddev->clevel));
3836 3839
3837 if (pers->level >= 4 && pers->level <= 6) 3840 if (pers->level >= 4 && pers->level <= 6)