| Previous | Next |
| kIOReturnLockedRead | kIOReturnExclusiveAccess |
kIOReturnLockedWrite
Do not retry a write blindly
kIOReturnLockedWrite reports that the device write path is locked. The common status does not say whether the lock is held by the same client, another client, a media transition, or a family-specific state machine. It says that the requested write cannot proceed in the current state.
This is important for recovery because writes can be state-changing. Unlike a read, a retry after a state change may duplicate a command or write data twice unless the interface defines idempotency or an operation identifier. Diagnose the locking transition and the request’s completion state before resubmission.
Useful checks
- Log the write range or command identity, caller, service state, and preceding open, claim, or configuration operations.
- Check whether a control operation, media transition, reset, or exclusive owner is expected to serialize writes.
- Wait for the documented completion or state notification instead of using a tight retry loop.
- Keep
kIOReturnLockedWriteseparate from a write capability failure such askIOReturnNotWritable.
References
- Apple XNU source: IOReturn.h
- Apple: Introduction to IOKit Fundamentals
- Apple: Managing data in IOKit
Looking for a different code? Search another status or error code.