Date: Tue, 7 Feb 2023 22:56:13 -0800 From: Enji Cooper <yaneurabeya@gmail.com> To: Alan Somers <asomers@FreeBSD.org> Cc: FreeBSD Hackers <freebsd-hackers@freebsd.org> Subject: Re: RFC: GEOM and hard disk LEDs Message-ID: <0155CD68-849E-40D6-95A5-6AAD5E229A57@gmail.com> In-Reply-To: <CAOtMX2hH5gEMj4tO2rq-x2DeRuB-o6RD83i-V1LB8F2T77GRCw@mail.gmail.com> References: <CAOtMX2h5=xCH1CN3ravsOLfmeMq=1-BOw1aSFGKVP-js6g38GA@mail.gmail.com> <CAOtMX2hH5gEMj4tO2rq-x2DeRuB-o6RD83i-V1LB8F2T77GRCw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_DB28F257-4E7D-401D-BDAE-ABD8D26EDCC6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Feb 7, 2023, at 3:30 PM, Alan Somers <asomers@FreeBSD.org> wrote: >=20 > Most modern SES backplanes have two LEDs per hard disk. There's a > "fault" LED and a "locate" LED. You can control either one with > sesutil(8) or, with a little more work, sg_ses from > sysutils/sg3_utils. They're very handy for tasks like replacing a > failed disk, especially in large enclosures. However, there isn't any > way to automatically control them. It would be very convenient if, > for example, zfsd(8) could do it. Basically, it would just set the > fault LED for any disk that has been kicked out of a ZFS pool, and > clear it for any disk that is healthy or is being resilvered. But > zfsd does not do that. Instead, users' only options are to write a > custom daemon or to use sesutil by hand. Instead of forcing all of us > to write our own custom daemons, why not train zfsd to do it? >=20 > My proposal is to add boolean GEOM attributes for "fault" and > "locate". A userspace program would be able to look up their values > for any geom with DIOCGATTR. Setting them would require a new ioctl > (DIOCSATTR?). The disk class would issue a ENCIOC_SETELMSTAT to > actually change the LEDs whenever this attribute changes. GEOM > transforms such as geli would simply pass the attribute through to > lower layers. Many-to-one transforms like gmultipath would pass the > attribute through to all lower layers. zfsd could then set all vdevs' > fault attributes when it starts up, and adjust individual disk's as > appropriate on an event-driven basis. >=20 > Questions: >=20 > * Are there any obvious flaws in this plan, any reasons why GEOM > attributes can't be used this way? >=20 > * For one-to-many transforms like gpart the correct behavior is less > clear: what if a disk has two partitions in two different pools, and > one of them is healthy but the other isn't? >=20 > * Besides ZFS, are there any other systems that could take advantage? >=20 > * SATA enclosures uses SGPIO instead of SES. SGPIO is too limited, > IMHO, to be of almost any use at all. I suggest not even trying to > make it work with this scheme. Out of curiosity, is there a way that a client of zfsd could = instead reach out to zfsd via a pipe, etc, when an event triggered by = devd occurs? Just trying to think of a way that would result in a cleaner = architecture than having zfsd doing a busy-loop of some kind waiting for = an event to happen. Thanks, -Enji --Apple-Mail=_DB28F257-4E7D-401D-BDAE-ABD8D26EDCC6 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEtvtxN6kOllEF3nmX5JFNMZeDGN4FAmPjR40ACgkQ5JFNMZeD GN6Ftg//cFCiDTr0UrqU7yPRSHNICezO6VjKHyPDBFjroIkmREmfVT3dDMhn1K3X y7TmsHLN6B9QrP9hr7HkCzHcAAME7Y7KTmL4Fva1uxUMwq+JNrGu1jERJKTLpoCB aLjTgWY3An7bK0Mg5qKTNTDpOyEIbp2seWhKzpyE6/enRaXzSFtm48TLoUAK6K4f pjMHXQxtL23+qInbkM9w1HDvK+eUU3v8u1LScVDloUQJp1rk2ySVJLfHu1wzdmua as/2mkX+JF48B9LKitX2vJGCcvPn6b9TucZEcBD9lXcMT50fpnk5KX0ts+HKRzO4 LfpoFP/6V1bOwrMlw+pged7UYpi1pmTmSbrOPgyOe3D/UH57uQH8l6mNKlWqjdC/ exoM5/7RNOAiQaTJsuewM4gGAmrixzTG6RPpNGsMHWioE8UWI8zQqRNlP9TB2+cF Vv3fQXad+MgsdKVsmKfkH6bDJTM0fACDQFSimmze7L3kNC105Pph/ZGcWDWQe7OW syrnHIcqDPuP2ElDCgRsQE+6MGlQEsoBokmQz8lkdjzlLFsn3WfisdMzLb7wSniy KHs2q2KOTamuHh0hoGd46IJUzW0b2yffLikONRg7Ao0opi1LSPFeRJfiy979Qd4s HI8ylwdc/y53N+MK8EWqhhvmvGl37jEwunAQR8MVtWXkgkszw7Q= =rYWb -----END PGP SIGNATURE----- --Apple-Mail=_DB28F257-4E7D-401D-BDAE-ABD8D26EDCC6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0155CD68-849E-40D6-95A5-6AAD5E229A57>