diff options
author | Doron Roberts-Kedes <doronrk@fb.com> | 2018-06-16 00:05:32 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-24 14:09:03 +0300 |
commit | 9b0b625841d89e94f7c5321a2bfe8ccbea8b8bb1 (patch) | |
tree | 028a40c07033c86ecad39d97f12635932b79b8d3 /include/uapi/linux | |
parent | fbeb2ee3ecca6ad25957a08e9ae69cb67071528d (diff) | |
download | linux-9b0b625841d89e94f7c5321a2bfe8ccbea8b8bb1.tar.xz |
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>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r-- | include/uapi/linux/nbd.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/uapi/linux/nbd.h b/include/uapi/linux/nbd.h index 85a3fb65e40a..20d6cc91435d 100644 --- a/include/uapi/linux/nbd.h +++ b/include/uapi/linux/nbd.h @@ -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 */ |