aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 49d6080387c8..c9c6a345e17b 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1356,7 +1356,8 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
1356{ 1356{
1357 if (!bitmap) return; 1357 if (!bitmap) return;
1358 if (behind) { 1358 if (behind) {
1359 atomic_dec(&bitmap->behind_writes); 1359 if (atomic_dec_and_test(&bitmap->behind_writes))
1360 wake_up(&bitmap->behind_wait);
1360 PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n", 1361 PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n",
1361 atomic_read(&bitmap->behind_writes), bitmap->max_write_behind); 1362 atomic_read(&bitmap->behind_writes), bitmap->max_write_behind);
1362 } 1363 }
@@ -1680,6 +1681,7 @@ int bitmap_create(mddev_t *mddev)
1680 atomic_set(&bitmap->pending_writes, 0); 1681 atomic_set(&bitmap->pending_writes, 0);
1681 init_waitqueue_head(&bitmap->write_wait); 1682 init_waitqueue_head(&bitmap->write_wait);
1682 init_waitqueue_head(&bitmap->overflow_wait); 1683 init_waitqueue_head(&bitmap->overflow_wait);
1684 init_waitqueue_head(&bitmap->behind_wait);
1683 1685
1684 bitmap->mddev = mddev; 1686 bitmap->mddev = mddev;
1685 1687