Skip to content

Change zpool offline spares policy#18282

Merged
behlendorf merged 1 commit intoopenzfs:masterfrom
tonyhutter:offline-spare
Mar 25, 2026
Merged

Change zpool offline spares policy#18282
behlendorf merged 1 commit intoopenzfs:masterfrom
tonyhutter:offline-spare

Conversation

@tonyhutter
Copy link
Contributor

@tonyhutter tonyhutter commented Mar 4, 2026

Motivation and Context

Make sure you can't force fault an offline spare.

Description

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.

How Has This Been Tested?

Added test case

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@behlendorf behlendorf added the Status: Code Review Needed Ready for review and testing label Mar 4, 2026
Copy link
Contributor

@akashb-22 akashb-22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

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.

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@tonyhutter tonyhutter changed the title Don't allow spares to force faulted Change zpool offline spares policy Mar 19, 2026
@tonyhutter
Copy link
Contributor Author

I've tweaked this PR a little. The new policy for force-faulting spares is:

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

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Mar 19, 2026
@behlendorf behlendorf merged commit b44a3ec into openzfs:master Mar 25, 2026
40 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants