From 700e432d8364ce59c521abbe03a522051610ebc2 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 28 Nov 2005 13:44:10 -0800 Subject: [PATCH] [PATCH] md: fix locking problem in r5/r6 bitmap_unplug actually writes data (bits) to storage, so we shouldn't be holding a spinlock... Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/raid5.c | 2 ++ drivers/md/raid6main.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index e2a40283e323..36d5f8ac8265 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -1704,7 +1704,9 @@ static void raid5d (mddev_t *mddev) if (conf->seq_flush - conf->seq_write > 0) { int seq = conf->seq_flush; + spin_unlock_irq(&conf->device_lock); bitmap_unplug(mddev->bitmap); + spin_lock_irq(&conf->device_lock); conf->seq_write = seq; activate_bit_delay(conf); } diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index eae5a35629c5..17d88d90d1ef 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c @@ -1784,7 +1784,9 @@ static void raid6d (mddev_t *mddev) if (conf->seq_flush - conf->seq_write > 0) { int seq = conf->seq_flush; + spin_unlock_irq(&conf->device_lock); bitmap_unplug(mddev->bitmap); + spin_lock_irq(&conf->device_lock); conf->seq_write = seq; activate_bit_delay(conf); } -- 2.30.2