[ENBD] Re: proxing ioctl's

Peter T. Breuer ptb@it.uc3m.es
Mon, 12 Mar 2001 20:39:21 +0100 (MET)


"A month of sundays ago Daniel Shane wrote:"
> Right now enbd transfers raw block device requests over the network, but
> could it also proxy various ioctls? The problem is that many ioctls take

Not quite sure what you mean ... but yes, one can make an ioctl call do
anything. It's very simple.

Can you elaborate?

Oh .. you want ioctls on special device files in a FS on an nbd mount
to have an effect at the server end instead of at the client end? This
is a generic problem in unix.

Can you give a concrete example? It might be easier than the general
case.

> arguments in the form of a pointer. As of now, I think that this is
> impossible since we would need to either :

The process context (and more) would need to be transferred in the
general case.  Most ioctls would be fine, however.

> a) Make a "send this struct" for every possible structure that could be

Mmmph .. address and size is enough. The problem is that one doesn't
know what the ioctl args mean in general, so it's useless to guess.

> passed as an ioctl arg. This is way to much work, and besides, we could have
> pointers inside arrays which make this nearly impossible.
> 
> b) When the server attempts to read from the pointer arg, trap the exception

Oh. Yeah. Impossibl-ish.

> and fetch the memory from the client. This also seems like an impossible
> task.

It's not so impossible though. It just needs "relocatable processes".

> I dont see any other solution... what do you guys think?

Can you suggest a particular example, without giving the game away, if
that's a concern?

Peter