md/raid1: clean up request counts properly in close_sync()
authorNeilBrown <neilb@suse.de>
Thu, 4 Sep 2014 06:30:38 +0000 (16:30 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 22 Sep 2014 01:26:01 +0000 (11:26 +1000)
commit669cc7ba77864e7b1ac39c9f2b2afb8730f341f4
treec4e1f885673cd7ee7e08a0eba38a68e7badf6cca
parentc6d119cf1b5a778e9ed60a006e2a434fcc4471a2
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: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c