diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-06-02 23:04:07 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-06-03 05:35:00 +0300 |
commit | cd4a4ae4683dc2e09380118e205e057896dcda2b (patch) | |
tree | 7991620de08c70556b880e5fc4917382d48e477d /include/linux | |
parent | d00a11df691466772435ec02471292eae07885e5 (diff) | |
download | linux-cd4a4ae4683dc2e09380118e205e057896dcda2b.tar.xz |
block: don't use blocking queue entered for recursive bio submits
If we end up splitting a bio and the queue goes away between
the initial submission and the later split submission, then we
can block forever in blk_queue_enter() waiting for the reference
to drop to zero. This will never happen, since we already hold
a reference.
Mark a split bio as already having entered the queue, so we can
just use the live non-blocking queue enter variant.
Thanks to Tetsuo Handa for the analysis.
Reported-by: syzbot+c4f9cebf9d651f6e54de@syzkaller.appspotmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blk_types.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 4cb970cdcd11..3c4f390aea4b 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -229,6 +229,8 @@ struct bio { * throttling rules. Don't do it again. */ #define BIO_TRACE_COMPLETION 10 /* bio_endio() should trace the final completion * of this bio. */ +#define BIO_QUEUE_ENTERED 11 /* can use blk_queue_enter_live() */ + /* See BVEC_POOL_OFFSET below before adding new flags */ /* |