Eric Biggers 93f221ae08 block: make blk_crypto_rq_bio_prep() able to fail
blk_crypto_rq_bio_prep() assumes its gfp_mask argument always includes
__GFP_DIRECT_RECLAIM, so that the mempool_alloc() will always succeed.

However, blk_crypto_rq_bio_prep() might be called with GFP_ATOMIC via
setup_clone() in drivers/md/dm-rq.c.

This case isn't currently reachable with a bio that actually has an
encryption context.  However, it's fragile to rely on this.  Just make
blk_crypto_rq_bio_prep() able to fail.

Suggested-by: Satya Tangirala <satyat@google.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Satya Tangirala <satyat@google.com>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2020-10-05 10:47:43 -06:00
..
2020-10-05 10:38:33 -06:00
2020-08-18 07:48:08 -07:00
2020-08-18 07:48:08 -07:00
2020-08-18 07:48:08 -07:00
2020-09-03 15:20:47 -06:00
2020-03-17 20:55:21 +01:00
2020-05-29 16:30:39 -06:00
2020-09-23 09:18:13 -06:00
2020-01-03 09:33:21 +01:00
2020-10-05 10:38:33 -06:00
2020-09-25 08:18:57 -06:00
2020-01-06 20:59:04 -07:00