]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
md/bitmap: fix saving of events_cleared and other state.
authorNeilBrown <neilb@suse.de>
Wed, 11 May 2011 04:26:30 +0000 (14:26 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 01:34:15 +0000 (10:34 +0900)
commit2fdcf29a363c69ec1937b0b1a402622bd99fabeb
treea953d8572def680bc797d8f9fd88dc5c9be0d5f3
parentff7c37c2f964d7e1f14966b3a1e5532705c7adee
md/bitmap: fix saving of events_cleared and other state.

commit 8258c53208d7a9b7207e7d4dae36d2ea384cb278 upstream.

If a bitmap is found to be 'stale' the events_cleared value
is set to match 'events'.
However if the array is degraded this does not get stored on disk.
This can subsequently lead to incorrect behaviour.

So change bitmap_update_sb to always update events_cleared in the
superblock from the known events_cleared.
For neatness also set ->state from ->flags.
This requires updating ->state whenever we update ->flags, which makes
sense anyway.

This is suitable for any active -stable release.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/md/bitmap.c