Skip to content
Commit 5e3c3a7e authored by Kevin Vigor's avatar Kevin Vigor Committed by Jens Axboe
Browse files

nbd: clear DISCONNECT_REQUESTED flag once disconnection occurs.



When a userspace client requests a NBD device be disconnected, the
DISCONNECT_REQUESTED flag is set. While this flag is set, the driver
will not inform userspace when a connection is closed.

Unfortunately the flag was never cleared, so once a disconnect was
requested the driver would thereafter never tell userspace about a
closed connection. Thus when connections failed due to timeout, no
attempt to reconnect was made and eventually the device would fail.

Fix by clearing the DISCONNECT_REQUESTED flag (and setting the
DISCONNECTED flag) once all connections are closed.

Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarKevin Vigor <kvigor@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2ab74cd2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment