From: majianpeng Date: Mon, 19 Mar 2012 01:46:42 +0000 (+1100) Subject: md: Add judgement bb->unacked_exist in function md_ack_all_badblocks(). X-Git-Tag: firefly_0821_release~3680^2~3308^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ecb178bb2b154a40cfae9fa4c42e62ccfa81ac6b;p=firefly-linux-kernel-4.4.55.git md: Add judgement bb->unacked_exist in function md_ack_all_badblocks(). If there are no unacked bad blocks, then there is no point searching for them to acknowledge them. Signed-off-by: majianpeng Signed-off-by: NeilBrown --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 21a90efb13b7..b572e1e386ce 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -8021,7 +8021,7 @@ void md_ack_all_badblocks(struct badblocks *bb) return; write_seqlock_irq(&bb->lock); - if (bb->changed == 0) { + if (bb->changed == 0 && bb->unacked_exist) { u64 *p = bb->page; int i; for (i = 0; i < bb->count ; i++) {