]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-ddf.c
DDF: getinfo_super_ddf_bvd: fix raid_disk calculation
authormwilck@arcor.de <mwilck@arcor.de>
Mon, 8 Jul 2013 21:50:42 +0000 (23:50 +0200)
committerNeilBrown <neilb@suse.de>
Wed, 10 Jul 2013 00:41:34 +0000 (10:41 +1000)
commit7c3fb3ecb327f34335d17c49fba5968c5d019965
tree125c3d82c35c653f3eadfa28e767a3a84837bf0f
parentf5ded78768f691e6a401185f8aef00b0c92967d7
DDF: getinfo_super_ddf_bvd: fix raid_disk calculation

The return value of disk.raid_disk may be wrong.
The old code was using raiddisk, which is only valid with auto
layout. This leads to errors when arrays are created with
specified disks and mdmon is already running, like this:

mdadm -CR /dev/md/container -n5 $d1 $d2 $d3 $d4 $d5
mdadm -CR /dev/md/r5 -n5 -l5 /dev/md/container -z 5000
mdadm -CR /dev/md/r1 -n2 -l1 $d1 $d2
  => resulting array will use wrong disks

This patch fixes that.

Signed-off-by: NeilBrown <neilb@suse.de>
super-ddf.c