]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super1.c
Grow: be careful of corrupt dev_roles list
authorNeilBrown <neilb@suse.de>
Fri, 26 Feb 2021 01:02:36 +0000 (12:02 +1100)
committerJes Sorensen <jsorensen@fb.com>
Wed, 3 Mar 2021 14:29:17 +0000 (09:29 -0500)
commit8818d4e7fe7cda900d5c00014b05cdde058bdd29
tree12dd72a08884c1c853d0041f7acbd19869315a2b
parent4ae96c802203ec3cfbb089240c56d61f7f4661b3
Grow: be careful of corrupt dev_roles list

I've seen a case where the dev_roles list of a linear array
was corrupt.  ->max_dev was > 128 and > raid_disks, and the
extra slots were '0', not 0xFFFE or 0xFFFF.

This caused problems when a 128th device was added.

So:
 1/ make Grow_Add_device more robust so that if numbers
   look wrong, it fails-safe.

 2/ make examine_super1() report details if the dev_roles
   array is corrupt.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c
super1.c