]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdadm/ddf: Abort when raid disk is smaller in getinfo_super_ddf
authorXiao Ni <xni@redhat.com>
Wed, 11 Oct 2023 13:03:32 +0000 (21:03 +0800)
committerJes Sorensen <jes@trained-monkey.org>
Thu, 26 Oct 2023 21:47:29 +0000 (17:47 -0400)
commit246b4b40558f6f7f84882e9c34659f1b582944e2
tree3d2c7d62b6291ecbfef500e06b597c12c1cc276f
parentc32b4754014c1eec8cc0c025fad2e9b621486164
mdadm/ddf: Abort when raid disk is smaller in getinfo_super_ddf

The metadata is corrupted when the raid_disk<0. So abort directly.
This also can avoid a building error:
super-ddf.c:1988:58: error: array subscript -1 is below array bounds of ‘struct phys_disk_entry[0]’

Suggested-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Ackedy-by: Xiao Ni <xni@redhat.com>
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
super-ddf.c