]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: don't set md arrays to readonly on shutdown.
authorNeilBrown <neilb@suse.de>
Mon, 19 Mar 2012 01:46:37 +0000 (12:46 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Apr 2012 16:52:46 +0000 (09:52 -0700)
commit6bd620a44f7fdb2755101517e878c17b0b730332
treecf9aa4e40b94d8fdf76a465f96b7c9dbfe40821c
parentaae19423e23df33f18e49f7558cb660aa485df90
md: don't set md arrays to readonly on shutdown.

commit c744a65c1e2d59acc54333ce80a5b0702a98010b upstream.

It seems that with recent kernel, writeback can still be happening
while shutdown is happening, and consequently data can be written
after the md reboot notifier switches all arrays to read-only.
This causes a BUG.

So don't switch them to read-only - just mark them clean and
set 'safemode' to '2' which mean that immediately after any
write the array will be switch back to 'clean'.

This could result in the shutdown happening when array is marked
dirty, thus forcing a resync on reboot.  However if you reboot
without performing a "sync" first, you get to keep both halves.

This is suitable for any stable kernel (though there might be some
conflicts with obvious fixes in earlier kernels).

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