nbd: Add the nbd NBD_DISCONNECT_ON_CLOSE config flag.
authorDoron Roberts-Kedes <doronrk@fb.com>
Fri, 15 Jun 2018 21:05:32 +0000 (14:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:03 +0000 (13:09 +0200)
commit9b0b625841d89e94f7c5321a2bfe8ccbea8b8bb1
tree028a40c07033c86ecad39d97f12635932b79b8d3
parentfbeb2ee3ecca6ad25957a08e9ae69cb67071528d
nbd: Add the nbd NBD_DISCONNECT_ON_CLOSE config flag.

[ Upstream commit 08ba91ee6e2c1c08d3f0648f978cbb5dbf3491d8 ]

If NBD_DISCONNECT_ON_CLOSE is set on a device, then the driver will
issue a disconnect from nbd_release if the device has no remaining
bdev->bd_openers.

Fix ret val so reconfigure with only setting the flag succeeds.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/nbd.c
include/uapi/linux/nbd.h