]> err.no Git - linux-2.6/commitdiff
[PATCH] md: ensure bitmap_writeback_daemon handles shutdown properly.
authorNeilBrown <neilb@cse.unsw.edu.au>
Fri, 9 Sep 2005 23:23:57 +0000 (16:23 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 23:39:13 +0000 (16:39 -0700)
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>
drivers/md/bitmap.c

index 90fe70d76a3164ae8941e4a6f7d10418bd62afcd..87145faac491a865d8c2f45f87fdaa031e5b1b62 100644 (file)
@@ -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 */