Commit e4c4bfe
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 <[email protected]>
Fixes: 3f38507 ("ublk: fix batch I/O recovery -ENODEV error")
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>1 parent dbc635c commit e4c4bfe
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2806 | 2806 | | |
2807 | 2807 | | |
2808 | 2808 | | |
| 2809 | + | |
2809 | 2810 | | |
2810 | 2811 | | |
2811 | | - | |
2812 | 2812 | | |
2813 | 2813 | | |
2814 | 2814 | | |
| |||
3435 | 3435 | | |
3436 | 3436 | | |
3437 | 3437 | | |
3438 | | - | |
| 3438 | + | |
| 3439 | + | |
3439 | 3440 | | |
3440 | | - | |
| 3441 | + | |
3441 | 3442 | | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
3442 | 3447 | | |
3443 | 3448 | | |
3444 | 3449 | | |
| |||
0 commit comments