Description of problem: I exported and then imported a whole disk (/dev/sda) and then just a partition of that disk, half the size (dev/sda1). The sectors and blocks reported for the whole disk seem a bit high. exporter: [root@morph-01 root]# gnbd_export -l Server[1] : sda1 -------------------------- file : /dev/sda1 sectors : 2147472809 readonly : no cached : yes timeout : no Server[2] : sda -------------------------- file : /dev/sda sectors : 18446744073709535232 readonly : no cached : yes timeout : no [root@morph-01 root]# cat /proc/partitions major minor #blocks name 3 0 39082680 hda 3 1 104391 hda1 3 2 37929465 hda2 3 3 1044225 hda3 8 0 2147475456 sda 8 1 1073736404 sda1 8 2 1073736405 sda2 importer: root@morph-02 root]# gnbd_import -l Device name : sda ---------------------- Minor # : 0 Proc name : /dev/gnbd0 Server : morph-01 Port : 14567 State : Close Connected Clear Readonly : No Sectors : 18446744073709535232 Device name : sda1 ---------------------- Minor # : 1 Proc name : /dev/gnbd1 Server : morph-01 Port : 14567 State : Close Connected Clear Readonly : No Sectors : 2147472809 [root@morph-02 root]# cat /proc/partitions major minor #blocks name 3 0 39082680 hda 3 1 104391 hda1 3 2 37929465 hda2 3 3 1044225 hda3 252 0 9223372036854767616 gnbd0 252 1 1073736404 gnbd1
I was using a large, when I meant to use an unsigned large variable, so the size flipped over into negative when I was converting from u32 to u64. This is now fixed
fix verified.