mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section
@ 2024-05-17 11:26 Zhiguo Niu
  2024-05-17 16:55 ` Markus Elfring
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zhiguo Niu @ 2024-05-17 11:26 UTC (permalink / raw)
  To: jaegeuk, chao
  Cc: linux-f2fs-devel, linux-kernel, niuzhiguo84, zhiguo.niu, ke.wang,
	Hao_hao.Wang

commit 245930617c9b ("f2fs: fix to handle error paths of {new,change}_curseg()")
missed this allocated path, fix it.

Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
---
 fs/f2fs/segment.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a0ce3d0..71dc8042 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -5190,7 +5190,9 @@ static int fix_curseg_write_pointer(struct f2fs_sb_info *sbi, int type)
 	if (cs->next_blkoff) {
 		unsigned int old_segno = cs->segno, old_blkoff = cs->next_blkoff;
 
-		f2fs_allocate_new_section(sbi, type, true);
+		err = f2fs_allocate_new_section(sbi, type, true);
+		if (err)
+			return err;
 		f2fs_notice(sbi, "Assign new section to curseg[%d]: "
 				"[0x%x,0x%x] -> [0x%x,0x%x]",
 				type, old_segno, old_blkoff,
-- 
1.9.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-21  0:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-17 11:26 [PATCH] f2fs: fix to check return value of f2fs_allocate_new_section Zhiguo Niu
2024-05-17 16:55 ` Markus Elfring
2024-05-20  1:21 ` Chao Yu
2024-05-20 19:52 ` Jaegeuk Kim
2024-05-21  0:56   ` Zhiguo Niu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®