md: forbid a RAID5 from having both a bitmap and a journal.
authorNeilBrown <neilb@suse.com>
Tue, 17 Oct 2017 03:24:09 +0000 (14:24 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:26:38 +0000 (11:26 +0100)
commita67936842ba66eb229e6322856fefd2310e0b3fb
treecc0d7318a9307fa2b3169b5b4e33f4c3265b3fe8
parent635526b896ca34fff5487d3ac00d04afbee7e1e4
md: forbid a RAID5 from having both a bitmap and a journal.

commit 230b55fa8d64007339319539f8f8e68114d08529 upstream.

Having both a bitmap and a journal is pointless.
Attempting to do so can corrupt the bitmap if the journal
replay happens before the bitmap is initialized.
Rather than try to avoid this corruption, simply
refuse to allow arrays with both a bitmap and a journal.
So:
 - if raid5_run sees both are present, fail.
 - if adding a bitmap finds a journal is present, fail
 - if adding a journal finds a bitmap is present, fail.

Signed-off-by: NeilBrown <neilb@suse.com>
Tested-by: Joshua Kinard <kumba@gentoo.org>
Acked-by: Joshua Kinard <kumba@gentoo.org>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/raid5.c