Commit 0a5aa8d
block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection
Commit 9d497e2 ("block: don't protect submit_bio_checks by
q_usage_counter") moved blk_mq_attempt_bio_merge and rq_qos_throttle
calls out of q_usage_counter protection. However, these functions require
q_usage_counter protection. The blk_mq_attempt_bio_merge call without
the protection resulted in blktests block/005 failure with KASAN null-
ptr-deref or use-after-free at bio merge. The rq_qos_throttle call
without the protection caused kernel hang at qos throttle.
To fix the failures, move the blk_mq_attempt_bio_merge and
rq_qos_throttle calls back to q_usage_counter protection.
Fixes: 9d497e2 ("block: don't protect submit_bio_checks by q_usage_counter")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20220308080915.3473689-1-shinichiro.kawasaki@wdc.com
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 3093929 commit 0a5aa8d
1 file changed
Lines changed: 23 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2718 | 2718 | | |
2719 | 2719 | | |
2720 | 2720 | | |
2721 | | - | |
| 2721 | + | |
| 2722 | + | |
2722 | 2723 | | |
2723 | 2724 | | |
2724 | 2725 | | |
| |||
2730 | 2731 | | |
2731 | 2732 | | |
2732 | 2733 | | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
2733 | 2739 | | |
2734 | 2740 | | |
2735 | 2741 | | |
| |||
2742 | 2748 | | |
2743 | 2749 | | |
2744 | 2750 | | |
| 2751 | + | |
2745 | 2752 | | |
2746 | 2753 | | |
2747 | 2754 | | |
2748 | 2755 | | |
2749 | 2756 | | |
2750 | | - | |
| 2757 | + | |
2751 | 2758 | | |
2752 | 2759 | | |
2753 | 2760 | | |
| |||
2757 | 2764 | | |
2758 | 2765 | | |
2759 | 2766 | | |
2760 | | - | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
2761 | 2775 | | |
2762 | | - | |
| 2776 | + | |
2763 | 2777 | | |
2764 | 2778 | | |
2765 | | - | |
| 2779 | + | |
2766 | 2780 | | |
2767 | 2781 | | |
2768 | 2782 | | |
| |||
2800 | 2814 | | |
2801 | 2815 | | |
2802 | 2816 | | |
2803 | | - | |
2804 | | - | |
2805 | | - | |
2806 | | - | |
2807 | | - | |
2808 | | - | |
| 2817 | + | |
2809 | 2818 | | |
2810 | | - | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
2811 | 2822 | | |
2812 | 2823 | | |
2813 | 2824 | | |
| |||
0 commit comments