From 91485ae83fa08fd98ce5bf036ccdad77ecd2a071 Mon Sep 17 00:00:00 2001 From: Kohei Enju Date: Sun, 2 Feb 2025 13:32:53 +0900 Subject: [PATCH] UPSTREAM: f2fs: remove unnecessary null checking When __GFP_DIRECT_RECLAIM (included in both GFP_NOIO and GFP_KERNEL) is specified, bio_alloc_bioset() never fails to allocate a bio. Commit 67883ade7a98 ("f2fs: remove FAULT_ALLOC_BIO") replaced f2fs_bio_alloc() with bio_alloc_bioset(), but null checking after bio_alloc_bioset() was still left. Fixes: 67883ade7a98 ("f2fs: remove FAULT_ALLOC_BIO") Change-Id: I7d7ff97a71e5031b86b21e8798c20f226a5b0b1b Signed-off-by: Kohei Enju Reviewed-by: Jens Axboe Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim (cherry picked from commit 53333cdf5b03870a8ed4f8d434bd98b3d6771d5f) --- fs/f2fs/data.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 751cc626b24a..66b61df06231 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1049,8 +1049,6 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, bio = bio_alloc_bioset(bdev, bio_max_segs(nr_pages), REQ_OP_READ | op_flag, for_write ? GFP_NOIO : GFP_KERNEL, &f2fs_bioset); - if (!bio) - return ERR_PTR(-ENOMEM); bio->bi_iter.bi_sector = sector; f2fs_set_bio_crypt_ctx(bio, inode, first_idx, NULL, GFP_NOFS); bio->bi_end_io = f2fs_read_end_io;