nbd: Add the nbd NBD_DISCONNECT_ON_CLOSE config flag.
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>
This commit is contained in:

committed by
Jens Axboe

parent
ce042c183b
commit
08ba91ee6e
@@ -53,6 +53,9 @@ enum {
|
||||
/* These are client behavior specific flags. */
|
||||
#define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
|
||||
disconnect. */
|
||||
#define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on
|
||||
* close by last opener.
|
||||
*/
|
||||
|
||||
/* userspace doesn't need the nbd_device structure */
|
||||
|
||||
|
Reference in New Issue
Block a user