OSDN Git Service

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)
committerShaohua Li <shli@fb.com>
Thu, 2 Nov 2017 04:32:18 +0000 (21:32 -0700)
commit230b55fa8d64007339319539f8f8e68114d08529
treea92153407e424000f93384e987a4dc0ffa77dfe0
parent235b6003fb28f0dd8e7ed8fbdb088bb548291766
md: forbid a RAID5 from having both a bitmap and a journal.

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.

Cc: stable@vger.kernel.org (4.10+)
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>
drivers/md/md-bitmap.c
drivers/md/md.c
drivers/md/raid5.c