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)
Sat, Dec 14, 1:02 PM
Unknown Object (File)
Thu, Dec 12, 6:30 PM
Unknown Object (File)
Mon, Dec 2, 1:05 PM
Unknown Object (File)
Mon, Dec 2, 1:05 PM
Unknown Object (File)
Mon, Dec 2, 12:45 PM
Unknown Object (File)
Oct 11 2024, 3:19 AM
Unknown Object (File)
Oct 5 2024, 7:04 PM
Unknown Object (File)
Sep 25 2024, 6:03 AM
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.