summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/xattr.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2019-06-20 11:36:14 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2019-07-02 15:40:41 -0700
commit10f966bbf521bb9b2e497bbca496a5141f4071d0 (patch)
tree828ab169692133b6220c3a547631349c0a0cbced /fs/f2fs/xattr.c
parentf91108b801ad7d7668c95841f4cb76494b2a9c8a (diff)
downloadlinux-10f966bbf521bb9b2e497bbca496a5141f4071d0.tar.bz2
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/xattr.c')
-rw-r--r--fs/f2fs/xattr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c
index e791741d193b..963242018663 100644
--- a/fs/f2fs/xattr.c
+++ b/fs/f2fs/xattr.c
@@ -346,7 +346,7 @@ static int lookup_all_xattrs(struct inode *inode, struct page *ipage,
*xe = __find_xattr(cur_addr, last_txattr_addr, index, len, name);
if (!*xe) {
- err = -EFAULT;
+ err = -EFSCORRUPTED;
goto out;
}
check:
@@ -622,7 +622,7 @@ static int __f2fs_setxattr(struct inode *inode, int index,
/* find entry with wanted name. */
here = __find_xattr(base_addr, last_base_addr, index, len, name);
if (!here) {
- error = -EFAULT;
+ error = -EFSCORRUPTED;
goto exit;
}