md/raid1: intialise start_next_window for READ case to avoid hang
authorNeilBrown <neilb@suse.de>
Mon, 22 Sep 2014 00:06:23 +0000 (10:06 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 22 Sep 2014 00:18:03 +0000 (10:18 +1000)
r1_bio->start_next_window is not initialised in the READ
case, so allow_barrier may incorrectly decrement
   conf->current_window_requests
which can cause raise_barrier() to block forever.

Fixes: 79ef3a8aa1cb1523cc231c9a90a278333c21f761
cc: stable@vger.kernel.org (v3.13+)
Reported-by: Brassow Jonathan <jbrassow@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid1.c

index d7690f86fdb9a6202edfa6d8fa5f95517fe8e75b..9ebccf624571da56e42506d7ccfef8fbe935ca0c 100644 (file)
@@ -1186,6 +1186,7 @@ read_again:
                                   atomic_read(&bitmap->behind_writes) == 0);
                }
                r1_bio->read_disk = rdisk;
+               r1_bio->start_next_window = 0;
 
                read_bio = bio_clone_mddev(bio, GFP_NOIO, mddev);
                bio_trim(read_bio, r1_bio->sector - bio->bi_iter.bi_sector,