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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -53,6 +53,9 @@ enum { · 52 unmodified lines | |||
| 53 | /* These are client behavior specific flags. */ | 53 | /* These are client behavior specific flags. */ |
| 54 | #define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on | 54 | #define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on |
| 55 | disconnect. */ | 55 | disconnect. */ |
| 56 | #define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on | ||
| 57 | * close by last opener. | ||
| 58 | */ | ||
| 56 | 59 | ||
| 57 | /* userspace doesn't need the nbd_device structure */ | 60 | /* userspace doesn't need the nbd_device structure */ |
| 58 | 61 | ||