nbd-client: don't set unset (zero) timeout when configuring via netlink
authorMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Fri, 17 Aug 2018 21:48:29 +0000 (23:48 +0200)
committerMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Fri, 17 Aug 2018 21:48:42 +0000 (23:48 +0200)
commitf617e49d5573322ea4a9c63c9e19130aa5295300
tree93c2309f44b8ea74953528640ca71c752c6a8c95
parente96b311caf9012ca69e3dac8953e22c56a5136db
nbd-client: don't set unset (zero) timeout when configuring via netlink

When we are operating as a daemon we ignore unset (zero) timeout in
set_timeout() and don't set it in kernel.
However, when operating in the netlink mode netlink_configure() will add
NBD_ATTR_TIMEOUT attribute unconditionally.

This means that in the default case of timeout being unset it was being set
to zero in the kernel which resulted in it triggering almost immediately
upon any I/O request.

Fix this by not appending the timeout attribute in netlink_configure() when
the timeout is unset.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
nbd-client.c