mirror of https://gitee.com/openkylin/linux.git
md/raid1: clean up request counts properly in close_sync()
If there are outstanding writes when close_sync is called,
the change to ->start_next_window might cause them to
decrement the wrong counter when they complete. Fix this
by merging the two counters into the one that will be decremented.
Having an incorrect value in a counter can cause raise_barrier()
to hangs, so this is suitable for -stable.
Fixes: 79ef3a8aa1
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
c6d119cf1b
commit
669cc7ba77
|
@ -1545,8 +1545,13 @@ static void close_sync(struct r1conf *conf)
|
|||
mempool_destroy(conf->r1buf_pool);
|
||||
conf->r1buf_pool = NULL;
|
||||
|
||||
spin_lock_irq(&conf->resync_lock);
|
||||
conf->next_resync = 0;
|
||||
conf->start_next_window = MaxSector;
|
||||
conf->current_window_requests +=
|
||||
conf->next_window_requests;
|
||||
conf->next_window_requests = 0;
|
||||
spin_unlock_irq(&conf->resync_lock);
|
||||
}
|
||||
|
||||
static int raid1_spare_active(struct mddev *mddev)
|
||||
|
|
Loading…
Reference in New Issue