diff options
| author | Ming Lei <ming.lei@redhat.com> | 2026-01-23 17:15:43 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-01-23 05:11:03 -0700 |
| commit | e4c4bfec2bb8db9963d87e8ccdf89cd9e485d7b6 (patch) | |
| tree | fa0ef8ef3279c1e1b43c1f7c20b1f820ac9f5dc8 /include | |
| parent | dbc635c4be7eba1d0e0fe0275a289ee3ccc63d72 (diff) | |
ublk: fix canceling flag handling in batch I/O recovery
Two issues with ubq->canceling flag handling:
1) In ublk_queue_reset_io_flags(), ubq->canceling is set outside
cancel_lock, violating the locking requirement. Move it inside
the spinlock-protected section.
2) In ublk_batch_unprep_io(), when rolling back after a batch prep
failure, if the queue became ready during prep (which cleared
canceling), the flag is not restored when the queue becomes
not-ready again. This allows new requests to be queued to
uninitialized IO slots.
Fix by restoring ubq->canceling = true under cancel_lock when the
queue transitions from ready to not-ready during rollback.
Reported-by: Jens Axboe <axboe@kernel.dk>
Fixes: 3f3850785594 ("ublk: fix batch I/O recovery -ENODEV error")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
