[PATCH 1/6] f2fs: fix to clear SBI_IS_CLOSE in __f2fs_remount()

From: Chao Yu

Date: Tue Dec 01 2026 - 06:09:02 EST


From: Chao Yu <chao@xxxxxxxxxx>

If f2fs_sync_fs() failed during remount ro, we need to clear SBI_IS_CLOSE,
even filesystem has already shut down.

Cc: stable@xxxxxxxxxxxxxxx
Fixes: dafb84f092a6 ("f2fs: fix to propagate error from f2fs_sync_fs()")
Signed-off-by: Chao Yu <chao@xxxxxxxxxx>
---
fs/f2fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 659b646284b9..c1233800f7ba 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3032,9 +3032,9 @@ static int __f2fs_remount(struct fs_context *fc, struct super_block *sb)
set_sbi_flag(sbi, SBI_IS_DIRTY);
set_sbi_flag(sbi, SBI_IS_CLOSE);
err = f2fs_sync_fs(sb, 1);
+ clear_sbi_flag(sbi, SBI_IS_CLOSE);
if (err)
goto restore_wb;
- clear_sbi_flag(sbi, SBI_IS_CLOSE);
}

/*
--
2.49.0