Skip to content

Commit

Permalink
[PATCH] md: ensure bitmap_writeback_daemon handles shutdown properly.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Sep 9, 2005
1 parent a6fb093 commit 9ba0053
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9ba0053

Please sign in to comment.