OSDN Git Service

nbd: wait uninterruptible for the dead timeout
authorJosef Bacik <jbacik@fb.com>
Mon, 6 Nov 2017 21:11:57 +0000 (16:11 -0500)
committerJens Axboe <axboe@kernel.dk>
Mon, 6 Nov 2017 21:15:02 +0000 (14:15 -0700)
If we have a pending signal or the user kills their application then
it'll bring down the whole device, which is less than awesome.  Instead
wait uninterruptible for the dead timeout so we're sure we gave it our
best shot.

Fixes: 560bc4b39952 ("nbd: handle dead connections")
Cc: stable@vger.kernel.org
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/nbd.c

index 3684e21..b94a735 100644 (file)
@@ -715,9 +715,9 @@ static int wait_for_reconnect(struct nbd_device *nbd)
                return 0;
        if (test_bit(NBD_DISCONNECTED, &config->runtime_flags))
                return 0;
-       wait_event_interruptible_timeout(config->conn_wait,
-                                        atomic_read(&config->live_connections),
-                                        config->dead_conn_timeout);
+       wait_event_timeout(config->conn_wait,
+                          atomic_read(&config->live_connections),
+                          config->dead_conn_timeout);
        return atomic_read(&config->live_connections);
 }