Commit b0077e2
blk-mq: make sure active queue usage is held for bio_integrity_prep()
blk_integrity_unregister() can come if queue usage counter isn't held
for one bio with integrity prepared, so this request may be completed with
calling profile->complete_fn, then kernel panic.
Another constraint is that bio_integrity_prep() needs to be called
before bio merge.
Fix the issue by:
- call bio_integrity_prep() with one queue usage counter grabbed reliably
- call bio_integrity_prep() before bio merge
Fixes: 900e080 ("block: move queue enter logic into blk_mq_submit_bio()")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Link: https://lore.kernel.org/r/20231113035231.2708053-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent b85ea95 commit b0077e2
1 file changed
Lines changed: 38 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2858 | 2858 | | |
2859 | 2859 | | |
2860 | 2860 | | |
2861 | | - | |
2862 | | - | |
2863 | | - | |
2864 | 2861 | | |
2865 | | - | |
| 2862 | + | |
2866 | 2863 | | |
2867 | 2864 | | |
2868 | 2865 | | |
| |||
2878 | 2875 | | |
2879 | 2876 | | |
2880 | 2877 | | |
2881 | | - | |
2882 | | - | |
2883 | 2878 | | |
2884 | 2879 | | |
2885 | 2880 | | |
2886 | | - | |
2887 | | - | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
2888 | 2884 | | |
2889 | | - | |
2890 | | - | |
| 2885 | + | |
| 2886 | + | |
2891 | 2887 | | |
2892 | | - | |
2893 | | - | |
2894 | | - | |
2895 | | - | |
2896 | | - | |
| 2888 | + | |
2897 | 2889 | | |
2898 | | - | |
2899 | | - | |
2900 | | - | |
2901 | | - | |
2902 | | - | |
2903 | | - | |
2904 | | - | |
2905 | 2890 | | |
2906 | 2891 | | |
2907 | | - | |
2908 | | - | |
2909 | | - | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
2910 | 2895 | | |
2911 | 2896 | | |
2912 | 2897 | | |
2913 | 2898 | | |
2914 | 2899 | | |
2915 | 2900 | | |
2916 | 2901 | | |
2917 | | - | |
| 2902 | + | |
2918 | 2903 | | |
2919 | 2904 | | |
2920 | | - | |
| 2905 | + | |
2921 | 2906 | | |
2922 | | - | |
| 2907 | + | |
2923 | 2908 | | |
2924 | 2909 | | |
2925 | 2910 | | |
| |||
2949 | 2934 | | |
2950 | 2935 | | |
2951 | 2936 | | |
2952 | | - | |
| 2937 | + | |
2953 | 2938 | | |
2954 | 2939 | | |
2955 | 2940 | | |
| |||
2960 | 2945 | | |
2961 | 2946 | | |
2962 | 2947 | | |
2963 | | - | |
2964 | | - | |
2965 | | - | |
2966 | 2948 | | |
2967 | 2949 | | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
2971 | 2957 | | |
2972 | | - | |
2973 | | - | |
| 2958 | + | |
2974 | 2959 | | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
2975 | 2975 | | |
2976 | 2976 | | |
| 2977 | + | |
2977 | 2978 | | |
2978 | 2979 | | |
2979 | 2980 | | |
| |||
0 commit comments