[PATCH] md: ensure bitmap_writeback_daemon handles shutdown properly. mddev->bitmap gets clearred before the writeback daemon is stopped. So the write_back daemon needs to be careful not to dereference the 'bitmap' if it is NULL. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 90fe70d7..87145fa 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c
@@ -1156,6 +1156,9 @@ err = -EINTR; goto out; } + if (bitmap == NULL) + /* about to be stopped. */ + return; PRINTK("%s: bitmap writeback daemon woke up...\n", bmname(bitmap)); /* wait on bitmap page writebacks */