[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 <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
NeilBrown 2005-11-28 13:44:10 -08:00 коммит произвёл Linus Torvalds
Родитель 22dfdf5212
Коммит 700e432d83
2 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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);
}

Просмотреть файл

@ -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);
}