]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: use more generic f2fs_stop_checkpoint()
authorChao Yu <chao@kernel.org>
Mon, 23 Mar 2026 08:38:33 +0000 (16:38 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 24 Mar 2026 17:21:01 +0000 (17:21 +0000)
Let's use more generic f2fs_stop_checkpoint() instead of
f2fs_handle_critical_error() to handle critical error in f2fs.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h
fs/f2fs/node.c
fs/f2fs/super.c

index 6dd39b7de11a454b30098858e79cc5dac91ac09e..01e1ba77263e30ca9de64d8457f910ba2cd6aafc 100644 (file)
@@ -232,15 +232,6 @@ static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
 static struct kmem_cache *ino_entry_slab;
 struct kmem_cache *f2fs_inode_entry_slab;
 
-void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
-                                               unsigned char reason)
-{
-       f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL);
-       if (!end_io)
-               f2fs_flush_merged_writes(sbi);
-       f2fs_handle_critical_error(sbi, reason);
-}
-
 /*
  * We guarantee no failure on the returned page.
  */
index 931f8394bb1802537eacd78a282658d1a90895cc..f2580faa076382da33bd661e1679ebb513972bd1 100644 (file)
@@ -3902,7 +3902,6 @@ int f2fs_do_quota_sync(struct super_block *sb, int type);
 loff_t max_file_blocks(struct inode *inode);
 void f2fs_quota_off_umount(struct super_block *sb);
 void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag);
-void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason);
 void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error);
 int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
 int f2fs_sync_fs(struct super_block *sb, int sync);
@@ -5087,7 +5086,7 @@ static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi,
                                f2fs_bug_on(sbi, 1);
                                return;
                        }
-                       f2fs_handle_critical_error(sbi, stop_reason);
+                       f2fs_stop_checkpoint(sbi, false, stop_reason);
                }
        } else {
                sbi->page_eio_ofs[type] = ofs;
index f04d3ac189cdc234f8509d1af112f0043f5d97ea..31085d659ccc954c1f86ee55fec197e1135f9888 100644 (file)
@@ -1774,7 +1774,7 @@ static bool __write_node_folio(struct folio *folio, bool atomic, bool *submitted
 
        if (f2fs_sanity_check_node_footer(sbi, folio, nid,
                                        NODE_TYPE_REGULAR, false)) {
-               f2fs_handle_critical_error(sbi, STOP_CP_REASON_CORRUPTED_NID);
+               f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_CORRUPTED_NID);
                goto redirty_out;
        }
 
index 8774c60b4be44ee9819578d59fefdb5804504fdf..a9adb619818481a54f5fae22e2295f3e9d8c58f7 100644 (file)
@@ -4650,7 +4650,8 @@ static bool system_going_down(void)
                || system_state == SYSTEM_RESTART;
 }
 
-void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason)
+static void f2fs_handle_critical_error(struct f2fs_sb_info *sbi,
+                                               unsigned char reason)
 {
        struct super_block *sb = sbi->sb;
        bool shutdown = reason == STOP_CP_REASON_SHUTDOWN;
@@ -4707,6 +4708,16 @@ void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason)
         */
 }
 
+void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
+                                               unsigned char reason)
+{
+       f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL);
+       if (!end_io)
+               f2fs_flush_merged_writes(sbi);
+       f2fs_handle_critical_error(sbi, reason);
+}
+
+
 static void f2fs_record_error_work(struct work_struct *work)
 {
        struct f2fs_sb_info *sbi = container_of(work,