]> git.ipfire.org Git - thirdparty/mdadm.git/commit - managemon.c
Fix: Sometimes mdmon throws core dump during reshape
authorAdam Kwolek <adam.kwolek@intel.com>
Tue, 7 Feb 2012 14:03:35 +0000 (15:03 +0100)
committerNeilBrown <neilb@suse.de>
Thu, 9 Feb 2012 01:20:52 +0000 (12:20 +1100)
commit50927b1323a4cfcbf3729ff552c496695d6199eb
tree7e1f75daee6cbce097de4dca8690f7e8f7842c67
parentbf5cf7c705f292a070746c83f9dd00d7662f458d
Fix: Sometimes mdmon throws core dump during reshape

Problem was found during reshaping 2 volumes /raid0 and raid5/ in container.
Sometimes mdmon throws core dump due to NULL pointer exception.

Problem occurs in scenario:
- managemon: is about spare activation (degraded raid4 volume == raid0 under takeover)
- managemon: detect level change and signals monitor (manage_member() calls replace_array())
- monitor: detects transition raid4/5->raid0 and sets a->container to NULL
           to indicate array deactivation
- managemon : continues his work and tries to activate spare (a->check_degraded is set).
              NULL pointer is passed to metadata handler activate_spare()
              Core dump is generated.

To resolve this situation managemon (after monitor kick) checks again
a->container pointer to learn if current array is not to be deactivated.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
managemon.c