• NeilBrown's avatar
    md/raid1: count resync requests in nr_pending. · 5c913439
    NeilBrown authored
    commit 34e97f17 upstream.
    
    Both normal IO and resync IO can be retried with reschedule_retry()
    and so be counted into ->nr_queued, but only normal IO gets counted in
    ->nr_pending.
    
    Before the recent improvement to RAID1 resync there could only
    possibly have been one or the other on the queue.  When handling a
    read failure it could only be normal IO.  So when handle_read_error()
    called freeze_array() the fact that freeze_array only compares
    ->nr_queued against ->nr_pending was safe.
    
    But now that these two types can interleave, we can have both normal
    and resync IO requests queued, so we need to count them both in
    nr_pending.
    
    This error can lead to freeze_array() hanging if there is a read
    error, so it is suitable for -stable.
    
    Fixes: 79ef3a8aReported-by: default avatarBrassow Jonathan <jbrassow@redhat.com>
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    5c913439
raid1.c 86.9 KB