diff mbox series

[f2fs-dev,2/2] f2fs: clear SBI_POR_DOING before initing inmem curseg

Message ID 20241111085058.4136077-2-shengyong@oppo.com (mailing list archive)
State Superseded
Headers show
Series [f2fs-dev,1/2] f2fs: fix changing cursegs if recovery fails on zoned device | expand

Commit Message

Sheng Yong Nov. 11, 2024, 8:50 a.m. UTC
SBI_POR_DOING can be cleared after recovery is completed, so that
changes made before recovery can be persistent, and subsequent
errors can be recorded into cp/sb.

Signed-off-by: Song Feng <songfeng@oppo.com>
Signed-off-by: Yongpeng Yang <yangyongpeng1@oppo.com>
Signed-off-by: Sheng Yong <shengyong@oppo.com>
---
 fs/f2fs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Chao Yu Nov. 18, 2024, 6:52 a.m. UTC | #1
On 2024/11/11 16:50, Sheng Yong wrote:
> SBI_POR_DOING can be cleared after recovery is completed, so that
> changes made before recovery can be persistent, and subsequent
> errors can be recorded into cp/sb.
> 
> Signed-off-by: Song Feng <songfeng@oppo.com>
> Signed-off-by: Yongpeng Yang <yangyongpeng1@oppo.com>
> Signed-off-by: Sheng Yong <shengyong@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
diff mbox series

Patch

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 42224c71ae20..92e93899c033 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -4756,13 +4756,13 @@  static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
 	if (err)
 		goto free_meta;
 
+	/* f2fs_recover_fsync_data() cleared this already */
+	clear_sbi_flag(sbi, SBI_POR_DOING);
+
 	err = f2fs_init_inmem_curseg(sbi);
 	if (err)
 		goto sync_free_meta;
 
-	/* f2fs_recover_fsync_data() cleared this already */
-	clear_sbi_flag(sbi, SBI_POR_DOING);
-
 	if (test_opt(sbi, DISABLE_CHECKPOINT)) {
 		err = f2fs_disable_checkpoint(sbi);
 		if (err)