Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Chao Yu and committed by
Jaegeuk Kim
be09d78b bd882ffd

+14 -13
-9
fs/f2fs/checkpoint.c
··· 232 232 static struct kmem_cache *ino_entry_slab; 233 233 struct kmem_cache *f2fs_inode_entry_slab; 234 234 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 - 244 235 /* 245 236 * We guarantee no failure on the returned page. 246 237 */
+1 -2
fs/f2fs/f2fs.h
··· 3902 3902 loff_t max_file_blocks(struct inode *inode); 3903 3903 void f2fs_quota_off_umount(struct super_block *sb); 3904 3904 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); 3906 3905 void f2fs_handle_error(struct f2fs_sb_info *sbi, unsigned char error); 3907 3906 int f2fs_commit_super(struct f2fs_sb_info *sbi, bool recover); 3908 3907 int f2fs_sync_fs(struct super_block *sb, int sync); ··· 5086 5087 f2fs_bug_on(sbi, 1); 5087 5088 return; 5088 5089 } 5089 - f2fs_handle_critical_error(sbi, stop_reason); 5090 + f2fs_stop_checkpoint(sbi, false, stop_reason); 5090 5091 } 5091 5092 } else { 5092 5093 sbi->page_eio_ofs[type] = ofs;
+1 -1
fs/f2fs/node.c
··· 1774 1774 1775 1775 if (f2fs_sanity_check_node_footer(sbi, folio, nid, 1776 1776 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); 1778 1778 goto redirty_out; 1779 1779 } 1780 1780
+12 -1
fs/f2fs/super.c
··· 4650 4650 || system_state == SYSTEM_RESTART; 4651 4651 } 4652 4652 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) 4654 4655 { 4655 4656 struct super_block *sb = sbi->sb; 4656 4657 bool shutdown = reason == STOP_CP_REASON_SHUTDOWN; ··· 4707 4706 * freeze_super() which will lead to deadlocks and other problems. 4708 4707 */ 4709 4708 } 4709 + 4710 + void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io, 4711 + unsigned char reason) 4712 + { 4713 + f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL); 4714 + if (!end_io) 4715 + f2fs_flush_merged_writes(sbi); 4716 + f2fs_handle_critical_error(sbi, reason); 4717 + } 4718 + 4710 4719 4711 4720 static void f2fs_record_error_work(struct work_struct *work) 4712 4721 {