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: call f2fs_handle_critical_error() to set cp_error flag

f2fs_handle_page_eio() is the only left place we set CP_ERROR_FLAG
directly, it missed to update superblock.s_stop_reason, let's
call f2fs_handle_critical_error() instead to fix that.

Introduce STOP_CP_REASON_READ_{META,NODE,DATA} stop_cp_reason enum
variable to indicate which kind of data we failed to read.

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
bd882ffd 5471834a

+22 -2
+19 -2
fs/f2fs/f2fs.h
··· 5070 5070 return; 5071 5071 5072 5072 if (ofs == sbi->page_eio_ofs[type]) { 5073 - if (sbi->page_eio_cnt[type]++ == MAX_RETRY_PAGE_EIO) 5074 - set_ckpt_flags(sbi, CP_ERROR_FLAG); 5073 + if (sbi->page_eio_cnt[type]++ == MAX_RETRY_PAGE_EIO) { 5074 + enum stop_cp_reason stop_reason; 5075 + 5076 + switch (type) { 5077 + case META: 5078 + stop_reason = STOP_CP_REASON_READ_META; 5079 + break; 5080 + case NODE: 5081 + stop_reason = STOP_CP_REASON_READ_NODE; 5082 + break; 5083 + case DATA: 5084 + stop_reason = STOP_CP_REASON_READ_DATA; 5085 + break; 5086 + default: 5087 + f2fs_bug_on(sbi, 1); 5088 + return; 5089 + } 5090 + f2fs_handle_critical_error(sbi, stop_reason); 5091 + } 5075 5092 } else { 5076 5093 sbi->page_eio_ofs[type] = ofs; 5077 5094 sbi->page_eio_cnt[type] = 0;
+3
include/linux/f2fs_fs.h
··· 80 80 STOP_CP_REASON_NO_SEGMENT, 81 81 STOP_CP_REASON_CORRUPTED_FREE_BITMAP, 82 82 STOP_CP_REASON_CORRUPTED_NID, 83 + STOP_CP_REASON_READ_META, 84 + STOP_CP_REASON_READ_NODE, 85 + STOP_CP_REASON_READ_DATA, 83 86 STOP_CP_REASON_MAX, 84 87 }; 85 88