]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
imsm: fix spare record writeout race
authorDan Williams <dan.j.williams@intel.com>
Wed, 14 Oct 2009 00:41:53 +0000 (17:41 -0700)
committerDan Williams <dan.j.williams@intel.com>
Wed, 14 Oct 2009 00:41:53 +0000 (17:41 -0700)
commitf796af5d5ea603085ce6bcf3c171b89a1f84f37a
tree3a8bc7e3604b2aa2df5d34ff7f722d48701eb586
parenta2b9798159755b6f5e867fae0dd3e25af59fc85e
imsm: fix spare record writeout race

imsm_activate_spare() in the manager thread may race against
write_super_imsm_spares() in the monitor thread.  Give
write_super_imsm_spares() its own private mpb buffer to prevent
confusing the manager.

This change uncovered cases where spares were not being assembled due to
a failed metadata version number check.  Spares can freely associate
across metadata version number, so reduce the scope of the version check
in the spare assembly case.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
super-intel.c