[ENBD] nbd 2.4.27: partition >4GB problem

Peter T. Breuer enbd@lists.community.tummy.com
Tue, 12 Mar 2002 16:34:21 +0100 (MET)


"A month of sundays ago Tad Kollar wrote:"
> I just got into ENBD the other day... started with nbd 2.4.27 and kernel 
> 2.4.18. It worked fine up until I tried to use a partition larger than 4GB. 

Interesting. 4GB is not a particularly significant point .. it's 2^32
and problems normally arise at 2^32 if anywhere, because of the sign
bit on ints.

> Above that point the client would always see the same erroneous size[1] (2TB) 
> for the partition, though the server reported[2] sending the correct size 
> (~26GB in this case).

Hmm ... interesting. If 2.4.26a gets it right and 2.4.27 does not, then
that is a bug which I will (quietly) correct. It's just hard to imagine
where it could be ...

> I tried kernel 2.4.17 and a few other things with no effect; it wasn't til I 
> downgraded to nbd 2.4.26a that the client started seeing the correct 

Are you using the same daemons? You must change both daemons if you change
kernel drivers (sorry! Factor of my failure to design in enough
redundancy in the network data structures).  

> number[3]. Kernel version 2.4.17 is the only one that I've tried nbd 2.4.26a with.
> 
> It looks like maybe a u64 is being passed to an s32 then back to a u64?
> 
> Tad
> 
> [1] /proc/nbdinfo with nbd-2.4.27:
> Device a:       Open
> [a] State:      verify, rw, enabled, plug, last error 0, lives 0
> [a] Queued:     +0R/0W curr (check 0R/0W) +0R/0W max
> [a] Buffersize: 262144  (sectors=512, blocks=256)
> [a] Blocksize:  1024    (log=10)
> [a] Size:       2147483647KB
> [a] Blocks:     2147483647

Client side ... says 2TB, no? That's a lot :-).

> [2] nbd-server output with nbd-2.4.27:
> nbd-server  1345: server (-2) locked /var/state/nbd/server-w0GYFF.client_ips
> nbd-server  1345: server (-2) unlocked /var/state/nbd/server-w0GYFF.client_ips
> nbd-server  1345: server (-2) set new signal handlers for master server 1345
> nbd-server  1345: server (-2) opened port 1111 (socket 5) for client 192.168.1.109
> nbd-server  1346: server (-1) set default signal handlers for session server 1346
> nbd-server  1346: server (-1) read passwd ok
> nbd-server  1346: server (-1) got cliserv magic ok
> nbd-server  1346: server (-1) received id device 2b00 ok
> nbd-server  1346: server (-1) sent size 26605232128 ok

That is 26GB.


> [3] /proc/nbdinfo with nbd-2.4.26a:
> Device a:       Open
> [a] State:      verify, rw, enabled, plug, last error 0, lives 0
> [a] Queued:     +0R/0W curr (check 0R/0W) +0R/0W max
> [a] Buffersize: 262144  (sectors=512, blocks=256)
> [a] Blocksize:  1024    (log=10)
> [a] Size:       25981672KB
> [a] Blocks:     25981672

26GB.


OK, I'll let you know in a little while. Meanwhile, humour me and
compile everything on one machine, then distribute client and server
(and kernel module) to both sides.


Peter