[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241021044801.1358850-1-yangyongpeng1@oppo.com>
Date: Mon, 21 Oct 2024 12:48:01 +0800
From: Yongpeng Yang <yangyongpeng1@...o.com>
To: Jaegeuk Kim <jaegeuk@...nel.org>,
Chao Yu <chao@...nel.org>
Cc: linux-f2fs-devel@...ts.sourceforge.net,
linux-kernel@...r.kernel.org,
Yongpeng Yang <yangyongpeng1@...o.com>
Subject: [PATCH] f2fs: check curseg->inited before write_sum_page in change_curseg
In the __f2fs_init_atgc_curseg->get_atssr_segment calling,
curseg->segno is NULL_SEGNO, indicating that there is no summary
block that needs to be written.
Signed-off-by: Yongpeng Yang <yangyongpeng1@...o.com>
---
fs/f2fs/segment.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1766254279d2..35f0b5065554 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -2926,7 +2926,8 @@ static int change_curseg(struct f2fs_sb_info *sbi, int type)
struct f2fs_summary_block *sum_node;
struct page *sum_page;
- write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));
+ if (curseg->inited)
+ write_sum_page(sbi, curseg->sum_blk, GET_SUM_BLOCK(sbi, curseg->segno));
__set_test_and_inuse(sbi, new_segno);
--
2.40.1
Powered by blists - more mailing lists