From: Anton Altaparmakov <aia21@cam.ac.uk>
To: pavel@suse.cz
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: NBD client/server broken?
Date: Sun, 24 Mar 2002 13:10:58 +0000 [thread overview]
Message-ID: <5.1.0.14.2.20020324125307.02899da0@pop.cus.cam.ac.uk> (raw)
Hi,
I have been trying to get nbd to work, the server is 2.4.18-pre7-ac2 and
the client is 2.5.7, and the exported device is /dev/hda1 a 15GiB partition.
I found and downloaded nbd.14.tar.gz. Is this the latest and greatest?
Compiling the package gives several warnings and indeed the nbd-server
doesn't work. The size auto detection code is completely bogus because it
submits 64 bit variables via their address to system calls which only take
32 bit variables so you see silly things like
es = (u64)-1
turning into
es = 0xffffffff01d4b139
instead of
es = 0x000000000whatever
You either need to use 64 bit variants of the calls or you need to submit a
32bit variable to the call, e.g. es32, and then expand it via es = (u64)es32.
So I got past this and fixed size detection for myself.
Now I get it to serve the first request but then it dies.
On the server I see:
[aia21@storm:~/nbd]$ ./nbd-server 5555 /dev/hda1 -r
Entering request loop!
1: *READ from 0 (0) len 4096, exp->buf, buf->net, +OK!
2: *[aia21@storm:~/nbd]$
And on the client I see:
[aia21@drop nbd]$ dd if=/dev/nd1 of=ffff bs=1024 count=8
NBD: receive - sock=-301251788 at buf=-65871580, size=16 returned 0.
NBD: Recv control failed.(result 0)
req should never be null
Kernel call returned.Closing: que, sock, done
NBD, minor 0: Request when not-ready.
dd: reading `/dev/nd0': Input/output error
4+0 records in
4+0 records out
[aia21@drop nbd]$
The contents of the 4kiB of data transmitted are correct so we are
definitely on the right track but something seems to be aborting the
request loop in the server program.
I will be looking into this as I _need_ this functionality very urgently
but I thought I would ask in case I have an out of data package of the nbd
utilities or someone has already fixed this and would like to share their
code with me...
Best regards,
Anton
--
"I've not lost my mind. It's backed up on tape somewhere." - Unknown
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/
next reply other threads:[~2002-03-24 13:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-24 13:10 Anton Altaparmakov [this message]
2002-03-24 18:46 ` Anton Altaparmakov
2002-03-24 20:16 ` Steven Whitehouse
2002-03-25 0:48 ` Anton Altaparmakov
2002-03-25 11:18 ` Pavel Machek
2002-03-25 11:00 ` Steven Whitehouse
2002-03-25 11:13 ` Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5.1.0.14.2.20020324125307.02899da0@pop.cus.cam.ac.uk \
--to=aia21@cam.ac.uk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®