Skip to contentSkip to conversation

f2fs: fix error path handling in f2fs_read_data_large_folio()

PATCH Applied Chao Yu 2 participants 2 messages Jan 16 – Jan 22 F2FS file system

lore
Share & tools
lore

Chao Yu

author maintainer
#0 lore raw

PATCH v2 1/1 f2fs: fix error path handling in f2fs_read_data_large_folio()

In error path of f2fs_read_data_large_folio(), if bio is valid, it may submit bio twice, fix it.

---
v2:
- rebase the code

 fs/f2fs/data.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
fs/f2fs/data.c +2 -5
index 5b4832956196..d685c889f7b6 100644
@@ -2577,17 +2577,14 @@ static int f2fs_read_data_large_folio(struct inode *inode,
 		folio_end_read(folio, !ret);
 		return ret;
 	}
-
+out:
+	f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
 	if (ret) {
-		f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
-
 		/* Wait bios and clear uptodate. */
 		folio_lock(folio);
 		folio_clear_uptodate(folio);
 		folio_unlock(folio);
 	}
-out:
-	f2fs_submit_read_bio(F2FS_I_SB(inode), bio, DATA);
 	return ret;
 }
 
Signature · 1 line
2.40.1
#1 lore raw
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 9 lines · On Fri, 16 Jan 2026 14:29:27 +0800 you wrote:

In error path of f2fs_read_data_large_folio(), if bio is valid, it may submit bio twice, fix it.

---
v2:
- rebase the code

 fs/f2fs/data.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Here is the summary with links:
- [f2fs-dev,v2] f2fs: fix error path handling in f2fs_read_data_large_folio()

    https://git.kernel.org/jaegeuk/f2fs/c/fe15bc3d447c

You are awesome, thank you!

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