#943 closed defect (fixed)
NetBSD regression in smartmontools 6.6
Reported by: | Alex Samorukov | Owned by: | |
---|---|---|---|
Priority: | critical | Milestone: | Release 7.0 |
Component: | all | Version: | 6.6 |
Keywords: | netbsd bigendian | Cc: |
Description (last modified by )
Smartctl is broken on netbsd/sparc64 (BE) arch
To test if smartctl still works on be i installed NetBSD7.0/sparc64 in the qemu.
It was found that smart support is mostly broken.
bash-4.4# uname -a NetBSD netbsd 7.0 NetBSD 7.0 (GENERIC.201509250726Z) sparc64
bash-4.4# ./smartctl -d ata /dev/wd0c -A smartctl 6.7 2017-11-16 r4625 [NetBSD 7.0 sparc64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org Read SMART Data failed: request failed, error code 0x02 === START OF READ SMART DATA SECTION === bash-4.4# ./smartctl -d ata /dev/wd0c -Ai smartctl 6.7 2017-11-16 r4625 [NetBSD 7.0 sparc64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Device Model: QEMU HARDDISK Serial Number: QM00001 Firmware Version: 2.5+ User Capacity: 5,368,709,120 bytes [5.36 GB] Sector Size: 512 bytes logical/physical Device is: Not in smartctl database [for details use: -P showall] ATA Version is: ATA/ATAPI-7, ATA/ATAPI-5 published, ANSI NCITS 340-2000 Local Time is: Sun Nov 19 10:35:54 2017 UTC SMART support is: Available - device has SMART capability. SMART support is: Enabled Read SMART Data failed: request failed, error code 0x02 === START OF READ SMART DATA SECTION ===
At the same time native tool works correctly:
bash-4.4# atactl wd0 smart status SMART supported, SMART enabled id value thresh crit collect reliability description raw 1 100 6 yes online positive Raw read error rate 0 3 100 0 yes online positive Spin-up time 16 4 100 20 no online positive Start/stop count 100 5 100 36 yes online positive Reallocated sector count 0 9 100 0 yes online positive Power-on hours count 1 12 100 0 yes online positive Device power cycle count 0 190 69 50 yes online positive Airflow Temperature 31 Lifetime min/max 31/0
Links:
Todo:
- install NetBSD 7.0 intel to check if bug is BE/sparc specific, check atactl code for the hints.
- Check previous smartmontools version (6.5)
Autodetection is broken in smartmontools 6.6/netbsd
sparc64# ./smartctl /dev/wd0c smartctl 6.7 2017-11-16 r4625 [NetBSD 7.0 sparc64] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org /dev/wd0c: Unable to detect device type Please specify device type with the -d option. Use smartctl -h to get a usage summary
Code in the netbsd_smart_interface::autodetect_smart_device(const char * name)
is very wrong
Change History (18)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Milestone: | → unscheduled |
---|
comment:3 by , 7 years ago
Did previous versions ever work on any NetBSD*/sparc64 ?
Thats why i want to do more testing :)
comment:4 by , 7 years ago
Description: | modified (diff) |
---|
comment:5 by , 7 years ago
Issue is BE specific, same test on same qemu version but with netbsdi386 works just fine:
bash-4.4# ./smartctl -d ata /dev/wd0d -A smartctl 6.7 2017-11-18 r4627 [NetBSD 7.0.2 i386] (local build) Copyright (C) 2002-17, Bruce Allen, Christian Franke, www.smartmontools.org === START OF READ SMART DATA SECTION === SMART Attributes Data Structure revision number: 1 Vendor Specific SMART Attributes with Thresholds: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x0003 100 100 006 Pre-fail Always - 0 3 Spin_Up_Time 0x0003 100 100 000 Pre-fail Always - 16 4 Start_Stop_Count 0x0002 100 100 020 Old_age Always - 100 5 Reallocated_Sector_Ct 0x0003 100 100 036 Pre-fail Always - 0 9 Power_On_Hours 0x0003 100 100 000 Pre-fail Always - 1 12 Power_Cycle_Count 0x0003 100 100 000 Pre-fail Always - 0 190 Airflow_Temperature_Cel 0x0003 069 069 050 Pre-fail Always - 31 (Min/Max 31/31)
comment:7 by , 7 years ago
Issue found:
req.cylinder = le16toh(in.in_regs.lba_mid | (in.in_regs.lba_high << 8));
Should be just
req.cylinder = in.in_regs.lba_mid | (in.in_regs.lba_high << 8);
Order is not changed here.
comment:8 by , 7 years ago
Priority: | minor → critical |
---|
comment:9 by , 7 years ago
Bug introduced recently:
req.cylinder = le16toh(in.in_regs.lba_mid | (in.in_regs.lba_high << 8));
was
req.cylinder = WDSMART_CYL;
Which is a static value. I will try to check if there are other issues introduced by the patch
comment:10 by , 7 years ago
Also auto-detection in patch is broken :( we should request more testing on such big patches.
comment:11 by , 7 years ago
Description: | modified (diff) |
---|---|
Summary: | Smartctl is broken on netbsd/sparc64 (BE) arch → NetBSD regression in smartmontools 6.6 |
comment:12 by , 7 years ago
Description: | modified (diff) |
---|
comment:14 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:15 by , 7 years ago
Keywords: | bigendian added |
---|
comment:16 by , 7 years ago
Milestone: | unscheduled → Release 6.7 |
---|
comment:17 by , 6 years ago
r4628 was backported to smartmontools 6.6 in NetBSD Package smartmontools-6.6nb1.
Did previous versions ever work on any NetBSD*/sparc64 ?