Skip to content

Commit

Permalink
[PATCH] md: fix locking problem in r5/r6
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Nov 28, 2005
1 parent 22dfdf5 commit 700e432
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/md/raid6main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 700e432

Please sign in to comment.