[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 2/3] nbd: unify behavior in timeout no matter how many sockets is configured



On 9/21/20 6:57 AM, Hou Pu wrote:
When an nbd device is configured with multiple sockets, the request
is requeued to an active socket in xmit_timeout, the original socket
is closed if not.

Some time, the backend nbd server hang, thus all sockets will be
dropped and the nbd device is not usable. It would be better to have an
option to wait for more time (just reset timer in nbd_xmit_timeout).
Like what we do if we only have one socket. This patch allows it.

Signed-off-by: Hou Pu <houpu@bytedance.com>
---
  drivers/block/nbd.c | 7 ++-----
  1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 538e9dcf5bf2..4c0bbb981cbc 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -400,8 +400,7 @@ static enum blk_eh_timer_return nbd_xmit_timeout(struct request *req,
  	    nbd->tag_set.timeout)
  		goto error_out;
- if (config->num_connections > 1 ||
-	    (config->num_connections == 1 && nbd->tag_set.timeout)) {
+	if (nbd->tag_set.timeout) {

So now if you don't set a .timeout and have num_connections > 1 we don't close the socket, so this won't work. Thanks,

Josef


Reply to: