projects/linux·commit 9ba00538

[PATCH] md: ensure bitmap_writeback_daemon handles shutdown properly.

9ba00538 · NeilBrown <[email protected]> · 2005-09-09 16:23:57 -07:00

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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
9ba00538ada7ecb4fb8bd71ba734a8eada987817
Parents
a6fb0934

Changes

1 files changed · +3 −0

FileStatusAddDelContent
drivers/md/bitmap.cmodified+3−0View file

drivers/md/bitmap.c

View file
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 90fe70d..87145fa 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 */