summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2019-06-20 05:36:14 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2019-07-03 00:40:41 +0200
commit10f966bbf521bb9b2e497bbca496a5141f4071d0 (patch)
tree828ab169692133b6220c3a547631349c0a0cbced /fs/f2fs/recovery.c
parentf2fs: Use DIV_ROUND_UP() instead of open-coding (diff)
downloadlinux-10f966bbf521bb9b2e497bbca496a5141f4071d0.tar.xz
linux-10f966bbf521bb9b2e497bbca496a5141f4071d0.zip
f2fs: use generic EFSBADCRC/EFSCORRUPTED
f2fs uses EFAULT as error number to indicate filesystem is corrupted all the time, but generic filesystems use EUCLEAN for such condition, we need to change to follow others. This patch adds two new macros as below to wrap more generic error code macros, and spread them in code. EFSBADCRC EBADMSG /* Bad CRC detected */ EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ Reported-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Chao Yu <yuchao0@huawei.com> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index 72c2c4ba795f..783773e4560d 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -553,7 +553,7 @@ retry_dn:
f2fs_warn(sbi, "Inconsistent ofs_of_node, ino:%lu, ofs:%u, %u",
inode->i_ino, ofs_of_node(dn.node_page),
ofs_of_node(page));
- err = -EFAULT;
+ err = -EFSCORRUPTED;
goto err;
}
@@ -565,13 +565,13 @@ retry_dn:
if (__is_valid_data_blkaddr(src) &&
!f2fs_is_valid_blkaddr(sbi, src, META_POR)) {
- err = -EFAULT;
+ err = -EFSCORRUPTED;
goto err;
}
if (__is_valid_data_blkaddr(dest) &&
!f2fs_is_valid_blkaddr(sbi, dest, META_POR)) {
- err = -EFAULT;
+ err = -EFSCORRUPTED;
goto err;
}