]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
imsm: fix: correct checking volume's degradation
authorLukasz Dorau <lukasz.dorau@intel.com>
Fri, 25 May 2012 13:06:41 +0000 (15:06 +0200)
committerNeilBrown <neilb@suse.de>
Mon, 28 May 2012 23:34:39 +0000 (09:34 +1000)
commite1993023991a6fa6539cc604b4b3d6718833250d
tree2e88dd985b712d70fcdb4f51940de5b022eaf09b
parent4687f160276a8f7815675ca758c598d881f04fd7
imsm: fix: correct checking volume's degradation

We do not check the return value of sysfs_get_ll() now. It is wrong.
If reading of the sysfs "degraded" key does not succeed,
the "new_degraded" variable will not be initiated
and accidentally it can have the value of "degraded" variable.
In that case the change of degradation will not be checked.

It happens if mdadm is compiled with gcc's "-fstack-protector" option
when one tries to stop a volume under reshape (e.g. OLCE).
Reshape seems to be finished then (metadata is in normal/clean state)
but it is not finished, it is broken and data are corrupted.

Now we always check the return value of sysfs_get_ll().
Even if reading of the sysfs "degraded" key does not succeed
(rv == -1) the change of degradation will be checked.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c