From: NeilBrown Date: Fri, 9 Sep 2005 23:23:57 +0000 (-0700) Subject: [PATCH] md: ensure bitmap_writeback_daemon handles shutdown properly. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9ba00538ada7ecb4fb8bd71ba734a8eada987817;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 90fe70d76a31..87145faac491 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1156,6 +1156,9 @@ static void bitmap_writeback_daemon(mddev_t *mddev) 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 */