Opened 9 years ago

Closed 8 years ago

#201 closed enhancement (fixed)

os_freebsd.cpp: Have smartd prefer real device names over passN

Reported by: dnelson Owned by: somebody
Priority: minor Milestone: Release 6.1
Component: smartd Version:
Keywords: freebsd Cc:

Description

The device scanning code in os_freebsd.cpp remembers the last name for a particular device. This can cause all your devices to be reported as "passN" if the pass device is last in the list:

# camcontrol devlist
<SEAGATE ST336754LC D402> at scbus0 target 0 lun 0 (da0,pass0)
<SEAGATE ST336754LC D402> at scbus0 target 1 lun 0 (da1,pass1)
<Hitachi HDS721016CLA382 JPEOA3FF> at scbus1 target 0 lun 0 (ada0,pass2)
<PLDS DVD-ROM DH-16D5S VD15> at scbus2 target 0 lun 0 (cd0,pass3)
<SAMSUNG HD161HJ JF100-22> at scbus3 target 0 lun 0 (ada1,pass4)

Unpatched smartd output:

Configuration file /usr/local/etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Device: /dev/pass0, opened
Device: /dev/pass0, [SEAGATE ST336754LC D402], 36.4 GB
Device: /dev/pass0, is SMART capable. Adding to "monitor" list.
Device: /dev/pass1, opened
Device: /dev/pass1, [SEAGATE ST336754LC D402], 36.4 GB
Device: /dev/pass1, is SMART capable. Adding to "monitor" list.
Device: /dev/pass2, opened
Device: /dev/pass2, Hitachi HDS721016CLA382, S/N:JPE060HH0RGT8P, WWN:5-000cca-370ca37a8, FW:JPEOA3FF, 160 GB
Device: /dev/pass2, found in smartd database: Hitachi Deskstar 7K1000.C
Device: /dev/pass2, is SMART capable. Adding to "monitor" list.

The attached patch keeps smartd from overwriting a good device name with "pass", resulting in much better detection:

Configuration file /usr/local/etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Device: /dev/da0, opened
Device: /dev/da0, [SEAGATE ST336754LC D402], 36.4 GB
Device: /dev/da0, is SMART capable. Adding to "monitor" list.
Device: /dev/da1, opened
Device: /dev/da1, [SEAGATE ST336754LC D402], 36.4 GB
Device: /dev/da1, is SMART capable. Adding to "monitor" list.
Device: /dev/ada0, opened
Device: /dev/ada0, Hitachi HDS721016CLA382, S/N:JPE060HH0RGT8P, WWN:5-000cca-370ca37a8, FW:JPEOA3FF, 160 GB
Device: /dev/ada0, found in smartd database: Hitachi Deskstar 7K1000.C
Device: /dev/ada0, is SMART capable. Adding to "monitor" list.

Attachments (1)

pass.diff (1.0 KB) - added by dnelson 9 years ago.

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by dnelson

Attachment: pass.diff added

comment:1 Changed 8 years ago by Alex Samorukov

I am a little concerned about this patch - it is possible that only passX devices are exported, for example in mfip driver.

comment:2 in reply to:  1 Changed 8 years ago by dnelson

Replying to samm2:

I am a little concerned about this patch - it is possible that only passX devices are exported, for example in mfip driver.

That's what the devname.empty() check is for. If this is the first name we have seen for the device (i.e. we have no "best" name yet), take it no matter what it is.

comment:3 Changed 8 years ago by Alex Samorukov

Milestone: Release 6.1
Resolution: fixed
Status: newclosed

committed in r3667, thank you.

Note: See TracTickets for help on using tickets.