Commit b637108
blk-mq: fix filesystem I/O request allocation
submit_bio_checks() may update bio->bi_opf, so we have to initialize
blk_mq_alloc_data.cmd_flags with bio->bi_opf after submit_bio_checks()
returns when allocating new request.
In case of using cached request, fallback to allocate new request if
cached rq isn't compatible with the incoming bio, otherwise change
rq->cmd_flags with incoming bio->bi_opf.
Fixes: 900e080 ("block: move queue enter logic into blk_mq_submit_bio()")
Reported-by: Geert Uytterhoeven <[email protected]>
Tested-by: Geert Uytterhoeven <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>1 parent b781d8d commit b637108
2 files changed
+45
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2521 | 2521 | | |
2522 | 2522 | | |
2523 | 2523 | | |
2524 | | - | |
2525 | | - | |
2526 | | - | |
2527 | | - | |
2528 | 2524 | | |
2529 | | - | |
| 2525 | + | |
2530 | 2526 | | |
2531 | 2527 | | |
2532 | 2528 | | |
| |||
2543 | 2539 | | |
2544 | 2540 | | |
2545 | 2541 | | |
2546 | | - | |
2547 | | - | |
| 2542 | + | |
2548 | 2543 | | |
2549 | 2544 | | |
2550 | 2545 | | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
2551 | 2558 | | |
2552 | 2559 | | |
2553 | 2560 | | |
2554 | 2561 | | |
2555 | 2562 | | |
2556 | 2563 | | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
2557 | 2567 | | |
2558 | | - | |
2559 | 2568 | | |
2560 | 2569 | | |
2561 | 2570 | | |
| |||
2564 | 2573 | | |
2565 | 2574 | | |
2566 | 2575 | | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
2567 | 2580 | | |
2568 | 2581 | | |
2569 | 2582 | | |
2570 | 2583 | | |
2571 | 2584 | | |
2572 | 2585 | | |
2573 | 2586 | | |
2574 | | - | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
2575 | 2596 | | |
2576 | 2597 | | |
2577 | 2598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 92 | + | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
| |||
108 | 100 | | |
109 | 101 | | |
110 | 102 | | |
111 | | - | |
112 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
113 | 117 | | |
114 | 118 | | |
115 | 119 | | |
| |||
0 commit comments