Project

General

Profile

Bug #68932

Bring in FreeBSD sesutil fixes

Added by Alexander Motin 9 months ago. Updated 7 months ago.

Status:
Done
Priority:
No priority
Assignee:
Ryan Moeller
Category:
OS
Target version:
Severity:
Medium
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

In system from ticket #66540 it stopped all fans. On my test system it causes SCSI command timeout and panic. I guess it may try to modify bits of wrong device, not disk slot, but something else, like fan or enclosure controller. May be off-by-one code error.


Related issues

Copied to FreeNAS - Bug #77619: Bring in FreeBSD sesutil fixesReady for Testing

Associated revisions

Revision ca97c293 (diff)
Added by Ryan Moeller 9 months ago

[usr.sbin/sesutil] Only operate on device slots 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. Ticket: #68932

History

#2 Updated by Ryan Moeller 9 months ago

  • Status changed from Unscreened to In Progress

#4 Updated by Ryan Moeller 9 months ago

  • Severity changed from New to Medium

I have attempted this command on another test system (fn03) and experienced unusual behavior there as well. The command took a minute or two to complete, so in addition to logging CDB printfs, I also captured procstat -kk for sesutil a few times while it was running. This should give me an indication of places to focus my attention on.

#5 Updated by Ryan Moeller 9 months ago

https://reviews.freebsd.org/D10458

Reverting this change resolves the buggy behavior, so I think there needs to be some additional check involved before trying to do_led() on an object. In the SES spec I see that the bits being twiddled do not control LEDs for all element types. Device element, device slot, array device slot are the types these bits should apply to. It looks like `sesutil fault all off` would end up telling the power supply control element to request the power supply be shut off. There are a lot of other element types where the IDENT bit is in a different position.

I will look into how to better filter the elements to avoid twiddling the wrong bits.

#6 Updated by Ryan Moeller 9 months ago

#7 Updated by Ryan Moeller 8 months ago

  • Status changed from In Progress to Ready for Testing
  • Target version changed from Backlog to 11.2-U3
  • Needs Merging changed from Yes to No

#8 Updated by Dru Lavigne 8 months ago

  • Subject changed from `sesutil locate all off` has unexpected side effects to Bring in FreeBSD sesutil fixes
  • Needs Doc changed from Yes to No

#9 Updated by Dru Lavigne 8 months ago

  • Copied to Bug #77619: Bring in FreeBSD sesutil fixes added

#14 Updated by Ryan Moeller 7 months ago

  • Status changed from Ready for Testing to Passed Testing

#16 Updated by Dru Lavigne 7 months ago

  • Status changed from Passed Testing to Done
  • Needs QA changed from Yes to No

Also available in: Atom PDF