From 2d821c12176bc1184701d548c987b2e2a39429ed Mon Sep 17 00:00:00 2001 From: Chao Yu Date: Tue, 18 Jun 2019 17:59:03 +0800 Subject: f2fs: print kernel message if filesystem is inconsistent As Pavel reported, once we detect filesystem inconsistency in f2fs_inplace_write_data(), it will be better to print kernel message as we did in other places. Reported-by: Pavel Machek Signed-off-by: Chao Yu Acked-by: Pavel Machek Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/f2fs') diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 4a6133cc9112..ee96e6fb1a50 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3242,6 +3242,8 @@ int f2fs_inplace_write_data(struct f2fs_io_info *fio) if (!IS_DATASEG(get_seg_entry(sbi, segno)->type)) { set_sbi_flag(sbi, SBI_NEED_FSCK); + f2fs_warn(sbi, "%s: incorrect segment(%u) type, run fsck to fix.", + __func__, segno); return -EFAULT; } -- cgit v1.2.3-58-ga151