On 08/09/2019 04:26 PM, Mike Christie wrote:
>
> +static void nbd_set_cmd_timeout(struct nbd_device *nbd, u64 timeout)
> +{
> + nbd->tag_set.timeout = timeout * HZ;
> + blk_queue_rq_timeout(nbd->disk->queue, timeout * HZ);
> +}
> +
> /* Must be called with config_lock held */
> static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
> unsigned int cmd, unsigned long arg)
> @@ -1275,10 +1281,8 @@ static int __nbd_ioctl(struct block_device *bdev,
> struct nbd_device *nbd,
> nbd_size_set(nbd, config->blksize, arg);
> return 0;
> case NBD_SET_TIMEOUT:
> - if (arg) {
> - nbd->tag_set.timeout = arg * HZ;
> - blk_queue_rq_timeout(nbd->disk->queue, arg * HZ);
> - }
> + if (arg)
> + nbd_set_cmd_timeout(nbd, arg);
> return 0;
Josef,
These patches still leave one regression where you used to be able to
disable the timer after it has already been set. My patches did not fix
that yet. I will fix it on the resend after you give me your comments.