[ENBD] Does it work with 2.4.17 kernel?

Peter T. Breuer enbd@lists.community.tummy.com
Thu, 14 Mar 2002 22:47:18 +0100 (MET)


"A month of sundays ago Piotr Wiejak wrote:"
> I'm using 2.4.17 kernel:
> bash-2.04# uname -a
> Linux muriell 2.4.17 #2 SMP wto lut 26 15:39:19 CET 2002 i686 unknown
> 
> Nbd does not work. I've compiled it with SMP flag. I try 2.4.26,27,28 
> versions. What's wrong? Please help me.

You tell me! It works here! Please try the "make test" routine in the
distributed Makefile.

> Server side:
> bash-2.04# nbd-server 1077 /root/image
...
> nbd-server 29644: server (-1) agreed 0 channels ok

Well, that should tell you!

> nbd-server 29640: server (-2) sighandler acks SIGCHLD
> nbd-server 29640: nullsigchldhandler child with pid 29644 died, remove from 

Different problem.

> Client side:
> bash-2.04# insmod /tmp/nbd.o
> bash-2.04# nbd-client localhost 1077 /dev/nd0

Wrong syntax. Well, not wrong but extremely unlikely to be what you
want. Look at the instructions in the INSTALL file, and the examples
in the man pages:

 NOTES
       The client has to run as root in order to access the  NBD.
       An example command line that starts a client identified as
       X0 with two connections of blocksize 4096  to  server1  on
       port 4017 is

       nbd-client server1:4017 /dev/nda -n 2 -i X0 -b 4096


> nbd-client 29642: client (-1) manager opened NBD device /dev/nd0 (2b00)
> nbd-client 29642: client (-1) left kernel bdflush sync boundary at 80%
> nbd-client 29642: client (-1) left kernel bdflush async boundary at 25%
> bash-2.04# nbd-client 29643: client (-1) starts introduction sequence on port 
> 1077
> nbd-client 29643: client (-1) got session port 1078 ok
> nbd-client 29643: client (-1) introduction sequence ends ok
> 
> 
> Any operation with /dev/nd0 fails with I/O error (e.g. raw "cat /dev/nd0")

There is no connection requested.  Have a look at /proc/nbdinfo, and
(putting it politely) "read the instructions". INSTALL:

   ...
   To do this test by hand. try some variant on:

    server: /tmp/nbd-server 12345 /tmp/core?
    client: insmod /tmp/nbd.o
    client: /tmp/nbd-client <server>:12345 <server> <server>

What I imagine is happening is that you are trying to use the syntax
from an older or different client.  While backwards compatibility is
maintained in the client, you may have found a bug in the interpretation
of old-style args.  At least one may think of it as that.  In fact the
interpretation has always been the same way - the "bug" is that at some
point I got fed up with people not asking for a connection in the
command line and changed the default number of connections from 0 to 1
in order to save people from themselves.

At least I did that for new-style arguments. But I would guess that
the changed default interpretation in the absence of a specific 
request for a certain number of channels never got applied to
old-style arguments. And that you are the first person to
simultaneously not ask for a nonzero number of connections
and use old style args.

At least that's what I'd guess. Congratulations.

Can you check that hypothesis by running "make test"?


Peter