bio: add in_task() check for bio alloc cache
authorJens Axboe <axboe@kernel.dk>
Thu, 19 Aug 2021 01:33:27 +0000 (19:33 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 Aug 2021 03:21:14 +0000 (21:21 -0600)
commitb5599bb5cd57ea6b2f240bc01df14359689ae538
treeab33e5f8a70071104791f42b3038ffc6c99f1b8f
parent13b17703b0be19f2054ce51022a2b34da759ab73
bio: add in_task() check for bio alloc cache

We must be in process context for freeing a bio that belongs to the
cache, since the cache itself is deliberately not IRQ safe. Be safe
and just check in_task() before using the cache free, if not just
use bio_free() which is always safe.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c