Skip to content

Commit be09d78

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: use more generic f2fs_stop_checkpoint()
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>
1 parent bd882ff commit be09d78

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,6 @@ static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)
232232
static struct kmem_cache *ino_entry_slab;
233233
struct kmem_cache *f2fs_inode_entry_slab;
234234

235-
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
236-
unsigned char reason)
237-
{
238-
f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL);
239-
if (!end_io)
240-
f2fs_flush_merged_writes(sbi);
241-
f2fs_handle_critical_error(sbi, reason);
242-
}
243-
244235
/*
245236
* We guarantee no failure on the returned page.
246237
*/

fs/f2fs/f2fs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3902,7 +3902,6 @@ int f2fs_do_quota_sync(struct super_block *sb, int type);
39023902
loff_t max_file_blocks(struct inode *inode);
39033903
void f2fs_quota_off_umount(struct super_block *sb);
39043904
void f2fs_save_errors(struct f2fs_sb_info *sbi, unsigned char flag);
3905-
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason);
39063905
void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error);
39073906
int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover);
39083907
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,
50875086
f2fs_bug_on(sbi, 1);
50885087
return;
50895088
}
5090-
f2fs_handle_critical_error(sbi, stop_reason);
5089+
f2fs_stop_checkpoint(sbi, false, stop_reason);
50915090
}
50925091
} else {
50935092
sbi->page_eio_ofs[type] = ofs;

fs/f2fs/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ static bool __write_node_folio(struct folio *folio, bool atomic, bool *submitted
17741774

17751775
if (f2fs_sanity_check_node_footer(sbi, folio, nid,
17761776
NODE_TYPE_REGULAR, false)) {
1777-
f2fs_handle_critical_error(sbi, STOP_CP_REASON_CORRUPTED_NID);
1777+
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_CORRUPTED_NID);
17781778
goto redirty_out;
17791779
}
17801780

fs/f2fs/super.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4650,7 +4650,8 @@ static bool system_going_down(void)
46504650
|| system_state == SYSTEM_RESTART;
46514651
}
46524652

4653-
void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason)
4653+
static void f2fs_handle_critical_error(struct f2fs_sb_info *sbi,
4654+
unsigned char reason)
46544655
{
46554656
struct super_block *sb = sbi->sb;
46564657
bool shutdown = reason == STOP_CP_REASON_SHUTDOWN;
@@ -4707,6 +4708,16 @@ void f2fs_handle_critical_error(struct f2fs_sb_info *sbi, unsigned char reason)
47074708
*/
47084709
}
47094710

4711+
void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io,
4712+
unsigned char reason)
4713+
{
4714+
f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL);
4715+
if (!end_io)
4716+
f2fs_flush_merged_writes(sbi);
4717+
f2fs_handle_critical_error(sbi, reason);
4718+
}
4719+
4720+
47104721
static void f2fs_record_error_work(struct work_struct *work)
47114722
{
47124723
struct f2fs_sb_info *sbi = container_of(work,

0 commit comments

Comments
 (0)