We can submit IO in a processes context, which means there can be
pending signals. This isn't a fatal error for NBD, but it does require
some finesse. If the signal happens before we transmit anything then we
are ok, just requeue the request and carry on. However if we've done a
partial transmit
The existing ioctl interface for configuring NBD devices is a bit
cumbersome and hard to extend. The other problem is we leave a
userspace app sitting in it's syscall until the device disconnects,
which is less than ideal.
This patch introduces a netlink interface for adding and disconnecting
nbd
Currently if we have multiple connections and one of them goes down we will tear
down the whole device. However there's no reason we need to do this as we
could have other connections that are working fine. Deal with this by keeping
track of the state of the different connections, and if we lose
In preparation for the upcoming netlink interface we need to not rely on
already having the bdev for the NBD device we are doing operations on.
Instead of passing the bdev around, just use it in places where we know
we already have the bdev.
Signed-off-by: Josef Bacik
---
drivers/block/nbd.c | 9
In preparation for seamless reconnects and the netlink configuration
interface we need a way to make sure our nbd device configuration
doesn't disappear until we are finished with it. So add a ref counter,
and on the final put we do all of the cleanup work on the nbd device.
At configuration time
We can't just set the timeout on the tagset, we have to set it on the
queue as it would have been setup already at this point.
Signed-off-by: Josef Bacik
---
drivers/block/nbd.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
inde
This is kind of a big batch of patches, but they all depend on eachother so it
was hard to tease out the fixes from the enhancements without making my life
miserable.
FIXES:
nbd: set queue timeout properly
nbd: handle ERESTARTSYS properly
The ERSTARTSYS one in particular is pretty awful as we can
http://track.thriftshopper.online/?xtl=9kysqmqx9yfrrkzdvbxpknx3zvoe3kcftmp38wgae1fbndreisamtcj9r06zxs3oz9961q7zr4iubeh3ma7qnt4nlgqoualq10e6ahsdi1hkdfdik9lbt7jx01gctf45bw8j5d70m3e8j9m1s953w5d325kd0ajantzee2gntverbg44aemep0qsm208b7uqudgamnwdsajy473qtxbteqlatw0ullg2nc1nu8yvfahis13ueiznwjqoi0yc77wnklyd