[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250801090647.2674590-1-hanqi@vivo.com>
Date: Fri, 1 Aug 2025 03:06:47 -0600
From: Qi Han <hanqi@...o.com>
To: jaegeuk@...nel.org,
chao@...nel.org
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Qi Han <hanqi@...o.com>
Subject: [PATCH] f2fs: remove unnecessary error checks
Commit 53333cdf5b03 ("f2fs: remove unnecessary null checking") removed
the null pointer check for bio in f2fs_grab_read_bio(), meaning
f2fs_grab_read_bio() will not return any errors. Therefore, let's remove
the remaining error handling code.
Fixes: 53333cdf5b03 ("f2fs: remove unnecessary null checking")
Signed-off-by: Qi Han <hanqi@...o.com>
---
fs/f2fs/data.c | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 711ad80b38d0..89cc5dc47c72 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -1095,9 +1095,6 @@ static int f2fs_submit_page_read(struct inode *inode, struct folio *folio,
bio = f2fs_grab_read_bio(inode, blkaddr, 1, op_flags,
folio->index, for_write);
- if (IS_ERR(bio))
- return PTR_ERR(bio);
-
/* wait for GCed page writeback via META_MAPPING */
f2fs_wait_on_block_writeback(inode, blkaddr);
@@ -2148,11 +2145,6 @@ static int f2fs_read_single_page(struct inode *inode, struct folio *folio,
bio = f2fs_grab_read_bio(inode, block_nr, nr_pages,
f2fs_ra_op_flags(rac), index,
false);
- if (IS_ERR(bio)) {
- ret = PTR_ERR(bio);
- bio = NULL;
- goto out;
- }
}
/*
@@ -2306,13 +2298,6 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
bio = f2fs_grab_read_bio(inode, blkaddr, nr_pages,
f2fs_ra_op_flags(rac),
folio->index, for_write);
- if (IS_ERR(bio)) {
- ret = PTR_ERR(bio);
- f2fs_decompress_end_io(dic, ret, true);
- f2fs_put_dnode(&dn);
- *bio_ret = NULL;
- return ret;
- }
}
if (!bio_add_folio(bio, folio, blocksize, 0))
--
2.48.1
Powered by blists - more mailing lists