Skip to contentSkip to conversation

f2fs: remove unnecessary null checking

PATCH Applied Kohei Enju 5 participants 5 messages Feb 2, 2025 – Feb 6, 2025 F2FS file system

lore
Share & tools
lore

Kohei Enju

author
#0 lore raw

PATCH 1/1 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")
---
 fs/f2fs/data.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/data.c +0 -2
index de4da6d9cd93..07b46b444d31 100644
@@ -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;
Signature · 1 line
2.39.5 (Apple Git-154)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Kohei Enju
Quoted 5 lines · Kohei Enju

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.

Signature · 1 line
Jens Axboe
maintainer Reviewed-by on v1 1/1
#3 lore raw
In reply to Kohei Enju
Quoted 8 lines · Kohei Enju

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")

Thanks,

#4 lore raw
In reply to Kohei Enju
This patch was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <[email protected]>:

Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <[email protected]>:

Quoted 10 lines · On Sun, 2 Feb 2025 13:32:53 +0900 you wrote:

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")

[...]

Here is the summary with links:
- [f2fs-dev,v1] f2fs: remove unnecessary null checking

    https://git.kernel.org/jaegeuk/f2fs/c/53333cdf5b03

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html