freebsd-src/usr.sbin/sesutil
Alan Somers a6506dda73 sesutil: fix "fault all" with zoned jbods
Some SAS JBODs support zoning.  This feature allows individual SAS
targets to be accessible by only some initiator ports.  One application
would be connecting two servers to the same JBOD, but they wouldn't be
able to see each other's disks.

A zoned JBOD should also prohibit initiators from accessing SES elements
corresponding to inaccessible SAS targets.  It reports that by setting
the element's status code to 0x8 (No Access Allowed).

The bug is that when doing "sesutil (fault|locate) all ...", sesutil
will attempt a ENCIOC_SETELMSTAT ioctl for every single element, even
the inaccessible ones.  The enclosure will reject the command, the
kernel will return EINVAL, and sesutil will exit.

The solution is to check the element's status, and skip trying to set it
if the status is 0x8.  But if the user actually supplied a ses ID, then
assume that he knows what he's doing and try to set it anyway.

PR:		270093
Sponsored by:	Axcient
Reviewed by:	mav, trasz
Differential Revision: https://reviews.freebsd.org/D39017

(cherry picked from commit 57dc6f5e20)
2023-09-06 14:39:35 -06:00
..
eltsub.c Remove $FreeBSD$: one-line .c comment pattern 2023-08-23 11:43:23 -06:00
eltsub.h Remove $FreeBSD$: one-line .c comment pattern 2023-08-23 11:43:23 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-23 11:43:30 -06:00
sesutil.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-23 11:43:31 -06:00
sesutil.c sesutil: fix "fault all" with zoned jbods 2023-09-06 14:39:35 -06:00