summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKohei Enju <enjuk@amazon.com>2025-02-02 13:32:53 +0900
committerJaegeuk Kim <jaegeuk@kernel.org>2025-02-06 18:34:43 +0000
commit53333cdf5b03870a8ed4f8d434bd98b3d6771d5f (patch)
treebdff08031bcbb1d93199ebe2e0b8fb2861a8c2bb
parentf2fs: introduce f2fs_base_attr for global sysfs entries (diff)
downloadlinux-53333cdf5b03870a8ed4f8d434bd98b3d6771d5f.tar.gz
linux-53333cdf5b03870a8ed4f8d434bd98b3d6771d5f.zip
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") Signed-off-by: Kohei Enju <enjuk@amazon.com> Reviewed-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/data.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index de4da6d9cd93..07b46b444d31 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1041,8 +1041,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;