Commit 7e26cb6
ublk: rely on ->canceling for dealing with ublk_nosrv_dev_should_queue_io
Now ublk deals with ublk_nosrv_dev_should_queue_io() by keeping request
queue as quiesced. This way is fragile because queue quiesce crosses syscalls
or process contexts.
Switch to rely on ubq->canceling for dealing with
ublk_nosrv_dev_should_queue_io(), because it has been used for this purpose
during io_uring context exiting, and it can be reused before recovering too.
In ublk_queue_rq(), the request will be added to requeue list without
kicking off requeue in case of ubq->canceling, and finally requests added in
requeue list will be dispatched from either ublk_stop_dev() or
ublk_ctrl_end_recovery().
Meantime we have to move reset of ubq->canceling from ublk_ctrl_start_recovery()
to ublk_ctrl_end_recovery(), when IO handling can be recovered completely.
Then blk_mq_quiesce_queue() and blk_mq_unquiesce_queue() are always used
in same context.
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Uday Shankar <ushankar@purestorage.com>
Link: https://lore.kernel.org/r/20250416035444.99569-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 00b3b0d commit 7e26cb6
1 file changed
Lines changed: 17 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1734 | 1734 | | |
1735 | 1735 | | |
1736 | 1736 | | |
| 1737 | + | |
| 1738 | + | |
1737 | 1739 | | |
1738 | 1740 | | |
1739 | 1741 | | |
1740 | 1742 | | |
1741 | 1743 | | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
1742 | 1747 | | |
1743 | 1748 | | |
| 1749 | + | |
1744 | 1750 | | |
1745 | 1751 | | |
1746 | 1752 | | |
| |||
2961 | 2967 | | |
2962 | 2968 | | |
2963 | 2969 | | |
2964 | | - | |
2965 | 2970 | | |
2966 | 2971 | | |
2967 | 2972 | | |
| |||
3048 | 3053 | | |
3049 | 3054 | | |
3050 | 3055 | | |
3051 | | - | |
3052 | | - | |
3053 | | - | |
3054 | | - | |
3055 | | - | |
3056 | | - | |
3057 | | - | |
3058 | | - | |
3059 | | - | |
3060 | | - | |
3061 | | - | |
3062 | | - | |
3063 | | - | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
3064 | 3063 | | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
3065 | 3068 | | |
3066 | 3069 | | |
3067 | 3070 | | |
| |||
0 commit comments