• Josef Bacik's avatar
    nbd: only clear the queue on device teardown · 2516ab15
    Josef Bacik authored
    When running a disconnect torture test I noticed that sometimes we would
    crash with a negative ref count on our queue.  This was because we were
    ending the same request twice.  Turns out we were racing with
    NBD_CLEAR_SOCK clearing the requests as well as the teardown of the
    device clearing the requests.  So instead make the ioctl only shutdown
    the sockets and make it so that we only ever run nbd_clear_que from the
    device teardown.
    Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    2516ab15
nbd.c 45.1 KB