]> git.proxmox.com Git - mirror_zfs.git/commit
Retry setting LED
authorChristopher Voltz <cjunk@voltz.ws>
Thu, 16 Feb 2017 21:41:48 +0000 (15:41 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 16 Feb 2017 21:41:48 +0000 (13:41 -0800)
commit100790a8dd7c7cbbcf35871d7361429e2ae09435
treecb11101cbe9d2631e64b0f1da835a19c07613460
parent43bd43f9ce3bb690be3bc83f9797c7fce01c6047
Retry setting LED

If the LED is being accessed by another process when we try to update
it, the update will be lost. Add a retry loop which will read the state
of the LED and update it until the LED is in the correct state. The
number of times this will occur is limited to ensure that the ZEDlet
won't hang ZED.

Refactor to remove duplication so setting of the LED occurs in only one
place.

Cleanup a couple of the warnings generated by shellcheck which weren't
the result of specific choices by the author. Several notes and warnings
are still present but removing them would make the code less clear or
require adding lines to tell shellcheck to ignore the warning.

Remove ",i" from the documentation at the top of the file which appears
to be a typographic error.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Christopher Voltz <christopher.voltz@hpe.com>
Closes #5795
cmd/zed/zed.d/statechange-led.sh