nbd: set queue timeout properly
authorJosef Bacik <jbacik@fb.com>
Fri, 24 Mar 2017 18:08:28 +0000 (14:08 -0400)
committerJens Axboe <axboe@fb.com>
Fri, 24 Mar 2017 21:42:47 +0000 (15:42 -0600)
We can't just set the timeout on the tagset, we have to set it on the
queue as it would have been setup already at this point.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c

index dbc22f4bed3da566fedbfafcdef9e7e83b962cec..b0003dab90b9ca46207c9e10791743519f4a7b0c 100644 (file)
@@ -844,7 +844,10 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
                nbd_size_set(nbd, bdev, nbd->blksize, arg);
                return 0;
        case NBD_SET_TIMEOUT:
-               nbd->tag_set.timeout = arg * HZ;
+               if (arg) {
+                       nbd->tag_set.timeout = arg * HZ;
+                       blk_queue_rq_timeout(nbd->disk->queue, arg * HZ);
+               }
                return 0;
 
        case NBD_SET_FLAGS: