diff mbox

nbd: reset the setup task for NBD_CLEAR_SOCK

Message ID 1481208755-24700-1-git-send-email-jbacik@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik Dec. 8, 2016, 2:52 p.m. UTC
If an app exits before running NBD_DO_IT but after adding sockets we can
end up not being allowed to do a new nbd device.  Fix this by making
NBD_CLEAR_SOCK reset the setup_task.

Signed-off-by: Josef Bacik <jbacik@fb.com>
---
 drivers/block/nbd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jens Axboe Dec. 8, 2016, 10:27 p.m. UTC | #1
On 12/08/2016 07:52 AM, Josef Bacik wrote:
> If an app exits before running NBD_DO_IT but after adding sockets we can
> end up not being allowed to do a new nbd device.  Fix this by making
> NBD_CLEAR_SOCK reset the setup_task.

Applied, thanks Josef.
diff mbox

Patch

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 0e6e52df..99c8446 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -705,6 +705,7 @@  static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
 			kfree(nbd->socks);
 			nbd->socks = NULL;
 			nbd->num_connections = 0;
+			nbd->task_setup = NULL;
 		}
 		return 0;