Merge branch 'master' in devel-3.0
[thirdparty/mdadm.git] / super1.c
index a4978e8..d1b8a94 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -885,6 +885,10 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk,
        else
                *rp = 0xfffe;
 
+       if (dk->number >= __le32_to_cpu(sb->max_dev) &&
+           __le32_to_cpu(sb->max_dev) < 384)
+               sb->max_dev = __cpu_to_le32(dk->number+1);
+
        sb->dev_number = __cpu_to_le32(dk->number);
        sb->sb_csum = calc_sb_1_csum(sb);