Bug 142870

Summary: invalid block and sector sizes reported by gnbd devices
Product: [Retired] Red Hat Cluster Suite Reporter: Corey Marthaler <cmarthal>
Component: gnbdAssignee: Ben Marzinski <bmarzins>
Status: CLOSED CURRENTRELEASE QA Contact: Cluster QE <mspqa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: cluster-maint
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-12-14 23:09:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2004-12-14 20:55:13 UTC
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

Comment 1 Ben Marzinski 2004-12-14 22:30:27 UTC
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

Comment 2 Corey Marthaler 2004-12-14 23:09:31 UTC
fix verified.