md: Add judgement bb->unacked_exist in function md_ack_all_badblocks().
authormajianpeng <majianpeng@gmail.com>
Mon, 19 Mar 2012 01:46:42 +0000 (12:46 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 19 Mar 2012 01:46:42 +0000 (12:46 +1100)
If there are no unacked bad blocks, then there is no point searching
for them to acknowledge them.

Signed-off-by: majianpeng <majianpeng@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 21a90efb13b7e74566aa3abed7a8185b3e47b6e8..b572e1e386ceab73643f3d0ffc272c1989b91474 100644 (file)
@@ -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++) {