• Mike Christie's avatar
    nbd: fix zero cmd timeout handling v2 · 2da22da5
    Mike Christie authored
    This fixes a regression added in 4.9 with commit:
    
    commit 0eadf37a
    Author: Josef Bacik <jbacik@fb.com>
    Date:   Thu Sep 8 12:33:40 2016 -0700
    
        nbd: allow block mq to deal with timeouts
    
    where before the patch userspace would set the timeout to 0 to disable
    it. With the above patch, a zero timeout tells the block layer to use
    the default value of 30 seconds. For setups where commands can take a
    long time or experience transient issues like network disruptions this
    then results in IO errors being sent to the application.
    
    To fix this, the patch still uses the common block layer timeout
    framework, but if zero is set, nbd just logs a message and then resets
    the timer when it expires.
    Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarMike Christie <mchristi@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    2da22da5
nbd.c 58 KB