dankamongmen / growlight

notcurses block device manager / system installation tool
https://nick-black.com/dankwiki/index.php/Growlight
GNU General Public License v3.0
85 stars 12 forks source link

empty space is always showing up as 18.45EB in 1.2.7 #83

Closed dankamongmen closed 4 years ago

dankamongmen commented 4 years ago

In the recently-released 1.2.7, we appear to display all empty space areas as 18.45EB. Note that this is, IIRC, the largest value that ncmetric() and friends can generate. This does not occur in growlight-readline:

[growlight](0)> blockdev -v
Device     Model             Rev   Bytes PSect Flags Table WWN              PHY 
sda        Samsung SSD 850  2B6Q 500.11G  512B ✔.W⚠. none  5002538d410be12f SAT3
Unused sectors 0:2047 (1023.50Ki)
sda1       8737d129-a5ff-4158-891e-a0c3de681b80 536.87M ESP n/a
GRIMESESP         vfat  4A46-49F5                            sda1   535.81M
 /boot/efi rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
sda2       51cb91e6-c93e-2a41-bffb-dc7ca38ad32a 107.91G Oth n/a
grimes            ext4  17a0a7c5-6497-4457-b27d-80d84a724516 sda2   105.68G
 / rw,relatime
sda3       288e9cbb-34b4-0a41-ae11-2f1ef16b1165 391.66G Oth n/a
Unused sectors 976773135:976773168 (16.50Ki)
dm-0       Linux devmapper   n/a 391.64G  512B VD... n/a   home             ?   
grimeshome        ext4  0572db93-21bc-4d81-a22b-3f176929f77b dm-0   384.42G
 /home rw,relatime

but happens in growlight on two different machines:


╭──────[ahci-0 (6Gbps demanded)]───────────────────────────────────────────[-]─╮
│        sda╭⇗⇨⇨⇨unpartitioned space──────────────────────────────────────────╮│
│✔solidstate│eeeeeeeeeeeeeeeeeeee 18.45E empty space eeeeeeeeeeeeeeeeeeee123em││
│25°  no i/o╰┤Samsung SSD 850  2B6Q 500.11G  512B none  5002538d410be12f SAT3├╯│
╰─────[Southbridge device 0000:00.17.0]────────────────────────────────────────╯

╭─press 'v' to dismiss details───────────────────────────────────────────────╮
│Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode]              │
│Firmware: N27ET38W (1.24 ) BIOS: LENOVO Load: 6Gbps                         │
│sda: Samsung SSD 8502B6Q (465.76GiB) S/N: S2RANX0H729580X WC+ WRV- RO-      │
│Sectors: 976773168 (512B logical / 512B physical) SAT3 (6Gbps)              │
│Partitioning: none I/O scheduler: [mq-deadline] none                        │
│  16.00EiB 976773169→2047 unpartitioned space                               │
│                                                                            │
╰────────────────────────────────────────────────────────────────────────────╯
dankamongmen commented 4 years ago

16.00EiB 976773169→2047 well there's our problem. I seem to recall this happening before? Having to do with zones (which IIRC are only a fullscreen concept, and not used in growlight-readline)?

This was a pretty big fuckup. We need better testing :(.

dankamongmen commented 4 years ago

Very interestingly, this doesn't seem to happen when we compile in Debug mode...

dankamongmen commented 4 years ago

It would seem that all the block devices showing this behavior are being detected as having layout of LAYOUT_NONE, which is odd, as they all have valid GPT partition tables...but that would explain the weird behavior, and I've verified it.

dankamongmen commented 4 years ago

Bah! Had important logic in an assert(), like a big stupid asshole.