]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: fix zero cmd timeout handling v2
authorMike Christie <mchristi@redhat.com>
Tue, 13 Aug 2019 16:39:52 +0000 (11:39 -0500)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Aug 2019 18:44:05 +0000 (12:44 -0600)
commit1132310f854788eb284fb2268b112f5b0162fc92
treec87fc744e953da3d4d25e6bb4ce87a2626dffb37
parent0d0a6b60600112b5152960b5c7ecccb8ffe03813
nbd: fix zero cmd timeout handling v2

This fixes a regression added in 4.9 with commit:

commit 4b9cc8ce5d6c24e65e5c29c14ff1d38ac523f6f5
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: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c