Page MenuHomeFreeBSD

usr.sbin/sesutil: Check element type before setting LEDs
ClosedPublic

Authored by freqlabs on Feb 1 2019, 2:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 19 2024, 3:57 PM
Unknown Object (File)
Mar 19 2024, 2:56 PM
Unknown Object (File)
Mar 15 2024, 8:17 PM
Unknown Object (File)
Mar 15 2024, 8:17 PM
Unknown Object (File)
Mar 12 2024, 6:42 PM
Unknown Object (File)
Mar 8 2024, 4:10 AM
Unknown Object (File)
Jan 4 2024, 8:47 AM
Unknown Object (File)
Oct 22 2023, 11:53 PM
Subscribers

Details

Summary

With rS319610, sesutil started twiddling the bits of every SES device.
Not everything is a disk slot, there are also fan controllers, temperature sensors, even power supplies, among other things controlled by SES.

Add a type check to make sure we are only operating on device slot and array device slot elements. Other type elements will be skipped, but it would be simple to add additional cases for controlling the ident LEDs of other element types (which are not necessarily the same bits).

Rather than doing raw bit manipulation of an unstructured byte array using unnamed numeric constants, leverage existing code abstractions.

Sponsored by: iXsystems, Inc.

Test Plan

I've tested this on a SES-capable machine.
Before the change, running sesutil locate all off for example would take a few minutes as the incorrect bits are being manipulated on the wrong hardware with unpredictable side effects.
After the change, the command runs in a fraction of a second, with the expected effect on slot LEDs. Likewise sesutil locate all on and the fault variations work as expected.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 1 2019, 4:14 AM
This revision was automatically updated to reflect the committed changes.