summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-crypt.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-01-24 10:10:53 +0100
committerJens Axboe <axboe@kernel.dk>2022-02-02 07:49:59 -0700
commit53db984e004c7116ce69e2f4a163664453336ae1 (patch)
tree61bb0a5aeb27d9c456aae35a8831d025bb56f3bc /drivers/md/dm-crypt.c
parent39146b6f66ba5c107d5c5758a17f290846165b4d (diff)
downloadlinux-53db984e004c7116ce69e2f4a163664453336ae1.tar.bz2
dm: bio_alloc can't fail if it is allowed to sleep
Remove handling of NULL returns from sleeping bio_alloc calls given that those can't fail. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220124091107.642561-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/dm-crypt.c')
-rw-r--r--drivers/md/dm-crypt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index d4ae31558826..20abe3486aba 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1673,9 +1673,6 @@ retry:
mutex_lock(&cc->bio_alloc_lock);
clone = bio_alloc_bioset(GFP_NOIO, nr_iovecs, &cc->bs);
- if (!clone)
- goto out;
-
clone_init(io, clone);
remaining_size = size;
@@ -1702,7 +1699,7 @@ retry:
bio_put(clone);
clone = NULL;
}
-out:
+
if (unlikely(gfp_mask & __GFP_DIRECT_RECLAIM))
mutex_unlock(&cc->bio_alloc_lock);