summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.h
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2022-09-28 23:38:54 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2022-10-04 13:31:45 -0700
commit95fa90c9e5a7f14c2497d5b032544478c9377c3a (patch)
treec5a868cfae65b1d969a30a1cdb750a4813f5cad1 /fs/f2fs/segment.h
parenta9cfee0ef98e99c8b1951dfd1d57a88580354d0d (diff)
downloadlinux-stable-95fa90c9e5a7f14c2497d5b032544478c9377c3a.tar.gz
linux-stable-95fa90c9e5a7f14c2497d5b032544478c9377c3a.tar.bz2
linux-stable-95fa90c9e5a7f14c2497d5b032544478c9377c3a.zip
f2fs: support recording errors into superblock
This patch supports to record detail reason of FSCORRUPTED error into f2fs_super_block.s_errors[]. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.h')
-rw-r--r--fs/f2fs/segment.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index d1d63766f2c7..be8f2d7d007b 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -753,6 +753,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Mismatch valid blocks %d vs. %d",
GET_SIT_VBLOCKS(raw_sit), valid_blocks);
set_sbi_flag(sbi, SBI_NEED_FSCK);
+ f2fs_handle_error(sbi, ERROR_INCONSISTENT_SIT);
return -EFSCORRUPTED;
}
@@ -767,6 +768,7 @@ static inline int check_block_count(struct f2fs_sb_info *sbi,
f2fs_err(sbi, "Wrong valid blocks %d or segno %u",
GET_SIT_VBLOCKS(raw_sit), segno);
set_sbi_flag(sbi, SBI_NEED_FSCK);
+ f2fs_handle_error(sbi, ERROR_INCONSISTENT_SIT);
return -EFSCORRUPTED;
}
return 0;