nbd
nbd copied to clipboard
nbd-client: Exit with error code other than EXIT_FAILURE
When nbd-client tries to connect to nbd device, it talks to kernel via netlink. If the nbd device is taken and locked by other process like systemd-udevd, kernel will return EBUSY to nbd client. However, nbd client just hide this error code with error message to check dmesg logs.
Checking the dmesg logs is error-prone and not friendly for other caller program. Instead, nbd-client should return the error code to the caller to handle it properly.