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

However, bio_crypt_clone() might be called with GFP_ATOMIC via
setup_clone() in drivers/md/dm-rq.c, or with GFP_NOWAIT via
kcryptd_io_read() in drivers/md/dm-crypt.c.

Neither case is currently reachable with a bio that actually has an
encryption context.  However, it's fragile to rely on this.  Just make
bio_crypt_clone() able to fail, analogous to bio_integrity_clone().

Reported-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Satya Tangirala <satyat@google.com>
Cc: Satya Tangirala <satyat@google.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-25 08:20:03 -06: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