zpool: Change zpool offline spares policy

The zpool offline man page says that you cannot use 'zpool offline'
on spares.  However, testing found that you could in fact force fault
(zpool offline -f) spares.

Change the policy to:
1. You can never force-fault or offline dRAID spares.
2. You can only force-fault or offline traditional spares if they're
   active.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ameer Hamza <ahamza@ixsystems.com>
Reviewed-by: Akash B <akash-b@hpe.com>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #18282
This commit is contained in:
Tony Hutter
2026-03-25 11:08:55 -07:00
committed by GitHub
parent 931deb290c
commit b44a3ecf4a
7 changed files with 137 additions and 8 deletions
+4 -3
View File
@@ -56,11 +56,12 @@
.Ar pool
.Ar device Ns …
.Xc
Takes the specified physical device offline.
Takes the specified physical device offline or force-fault it.
While the
.Ar device
is offline, no attempt is made to read or write to the device.
This command is not applicable to spares.
is offline or force-faulted, no attempt is made to read or write to the device.
dRAID spares can not be offlined or force faulted.
Traditional spares can only be offlined or force-faulted when they are active.
.Bl -tag -width Ds
.It Fl -power
Power off the device's slot in the storage enclosure.