]> git.ipfire.org Git - thirdparty/mdadm.git/commit - util.c
imsm: fix family number handling
authorDan Williams <dan.j.williams@intel.com>
Sat, 1 Aug 2009 00:11:41 +0000 (17:11 -0700)
committerDan Williams <dan.j.williams@intel.com>
Sat, 1 Aug 2009 00:11:41 +0000 (17:11 -0700)
commit148acb7baaa810b68d55df4c1784d6bd0dfd1b78
treec3b39f9c4961296d88de6761a55d33eb423743e2
parent329c82786932b2fbc56cd57ac0bfc185d83a04c9
imsm: fix family number handling

The family_number field can change.  The option-rom will change the
family number when it starts a rebuild process (flags a container for
rebuild).  This was not seen previously as mdadm would usually start the
rebuild process, preserving the family number.

This is the mechanism that helps to prevent a prodigal array member from
being returned to its original system and cause a rebuild to go in the
wrong direction.  With the change we will end up with a container that
will fail to assemble unless the device with the incompatible family
number is left out of the assembly.

So, take several actions:
1/ Convert uuid generation to use orig_family_num, being careful to
   preserve the existing uuid in the case where orig_family_num is not
   set (i.e. previous mdadm created imsm arrays)
2/ Set orig_family_num at Create.  For arrays created by mdadm prior to
   this release orig_family_num will be zero, so set it to family_num at
   the first metadata write.
3/ Add checks for orig_family_num to compare_super_imsm
4/ Update the family number when initiating rebuild
5/ The option-rom mixes some random data into the family number, add
   this functionality to the mdadm implementation.

Reported-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdadm.h
super-ddf.c
super-intel.c
util.c