Commit 700e432d authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds

[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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 22dfdf52
...@@ -1704,7 +1704,9 @@ static void raid5d (mddev_t *mddev) ...@@ -1704,7 +1704,9 @@ static void raid5d (mddev_t *mddev)
if (conf->seq_flush - conf->seq_write > 0) { if (conf->seq_flush - conf->seq_write > 0) {
int seq = conf->seq_flush; int seq = conf->seq_flush;
spin_unlock_irq(&conf->device_lock);
bitmap_unplug(mddev->bitmap); bitmap_unplug(mddev->bitmap);
spin_lock_irq(&conf->device_lock);
conf->seq_write = seq; conf->seq_write = seq;
activate_bit_delay(conf); activate_bit_delay(conf);
} }
......
...@@ -1784,7 +1784,9 @@ static void raid6d (mddev_t *mddev) ...@@ -1784,7 +1784,9 @@ static void raid6d (mddev_t *mddev)
if (conf->seq_flush - conf->seq_write > 0) { if (conf->seq_flush - conf->seq_write > 0) {
int seq = conf->seq_flush; int seq = conf->seq_flush;
spin_unlock_irq(&conf->device_lock);
bitmap_unplug(mddev->bitmap); bitmap_unplug(mddev->bitmap);
spin_lock_irq(&conf->device_lock);
conf->seq_write = seq; conf->seq_write = seq;
activate_bit_delay(conf); activate_bit_delay(conf);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment