]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: restore default timeout when setting it to zero
authorHou Pu <houpu@bytedance.com>
Mon, 10 Aug 2020 12:00:44 +0000 (08:00 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 26 Aug 2020 15:08:49 +0000 (09:08 -0600)
commitdc658c5efd99d3ce8dd60a67a0e3ede2f7f01f38
tree9d6ec5a213efd4479562c803cd13728287282484
parent2f57e1a1939194c70625a8221d4d16a769580359
nbd: restore default timeout when setting it to zero

If we configured io timeout of nbd0 to 100s. Later after we
finished using it, we configured nbd0 again and set the io
timeout to 0. We expect it would timeout after 30 seconds
and keep retry. But in fact we could not change the timeout
when we set it to 0. the timeout is still the original 100s.

So change the timeout to default 30s when we set it to zero.
It also behaves same as commit 1c599a584be6 ("nbd: fix zero
cmd timeout handling v2").

It becomes more important if we were reconfigure a nbd device
and the io timeout it set to zero. Because it could take 30s
to detect the new socket and thus io could be completed more
quickly compared to 100s.

Signed-off-by: Hou Pu <houpu@bytedance.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c