Skip to content

Conversation

rrevans
Copy link
Contributor

@rrevans rrevans commented Oct 9, 2025

This is useful for reproducing races during the sync pipeline.

See #16025 (comment) for use in the repro case for free_children panic in #16025.

Motivation and Context

Blocking in the kernel on injection events allows reliably hitting race windows created by zinject.

Description

Adds a new ioctl ZFS_IOC_WAIT_INJECT to wait for inject events, libzfs marshalling call, and a zinject command.

Callers must have admin privileges to use wait on injection events.

The kernel stores a state of the number of events so far, and callers pass in this state to block until another event occurs. This pattern allows the waiter to obtain the state before triggering the inject event to reliably wake exactly when the injection event has fired.

I'm open to feedback on the kernel code as well as the ioctl, API, and zinject command syntax.

How Has This Been Tested?

ZTS and by running the repro case from 16025.

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:

@github-actions github-actions bot added the Status: Work in Progress Not yet ready for general review label Oct 9, 2025
This is useful for reproducing races during the sync pipeline

Signed-off-by: Robert Evans <[email protected]>
@rrevans rrevans marked this pull request as ready for review October 12, 2025 13:18
@github-actions github-actions bot added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress Not yet ready for general review labels Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Code Review Needed Ready for review and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant