[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] transparent handling of nbd reconnections at kernel level



Hi Juan,

On 20-05-13 14:16, Juan Antonio Martinez wrote:
[...snip problem statement...]
> So my question:
> Is there any way to get nbd kernel module waiting for server client
> execute finnish_sock() routine to tell the new socket to talk to,
> instead of inmediate return of ioerror ?

This was originally implemented after a short (off-list?) discussion
between Paul and myself. At the time, the plan was that the kernel
module would block all access to the device until the active nbd-client
process would exit. The client process could then either reconnect and
hand back a socket (in which case we're in persist mode and we continue
as before) or just exit (and then any further reads start failing). I
think this is a fairly clean interface.

I don't think we tested this much, however, and it may be that it
doesn't work as advertised.

> Perhaps a new ioctl() or nbd_flag option to say kernel that client is in
> "persist mode" and wait instead of return?

I suppose that could work, but I don't think it's required; all the
kernel needs to do is wait for userspace to give up or return.

After all, a reconnect might always fail for one reason or another, in
which case userspace might decide that disconnecting is the right thing
to do, now. If we're waiting because the kernel thinks we're in "persist
mode", this isn't very helpful.

Regards,

-- 
This end should point toward the ground if you want to go to space.

If it starts pointing toward space you are having a bad problem and you
will not go to space today.

  -- http://xkcd.com/1133/



Reply to: