diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-08-14 18:37:03 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-15 14:24:30 +0200 |
commit | a6b9b1d5eae61a68085030e50d56265dec5baa94 (patch) | |
tree | c2f8f140cf5d0c1061c9c0e0cd65a46ebe2086ba /drivers/staging/erofs/xattr.c | |
parent | d247ceda6ae65968bda1bf7a26b54a257a414c7a (diff) | |
download | linux-stable-a6b9b1d5eae61a68085030e50d56265dec5baa94.tar.gz linux-stable-a6b9b1d5eae61a68085030e50d56265dec5baa94.tar.bz2 linux-stable-a6b9b1d5eae61a68085030e50d56265dec5baa94.zip |
staging: erofs: introduce EFSCORRUPTED and more logs
Previously, EROFS uses EIO to indicate that filesystem
is corrupted as well. However, as Pavel said [1], other
filesystems tend to use EUCLEAN(EFSCORRUPTED) instead,
let's follow what others do right now.
Also, add some more prints to the syslog.
[1] https://lore.kernel.org/lkml/20190813114821.GB11559@amd/
Suggested-by: Pavel Machek <pavel@denx.de>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190814103705.60698-1-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/xattr.c')
-rw-r--r-- | drivers/staging/erofs/xattr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c index 289c7850ec96..c5bfc9be412f 100644 --- a/drivers/staging/erofs/xattr.c +++ b/drivers/staging/erofs/xattr.c @@ -75,8 +75,9 @@ static int init_inode_xattrs(struct inode *inode) goto out_unlock; } else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) { if (unlikely(vi->xattr_isize)) { + errln("bogus xattr ibody @ nid %llu", vi->nid); DBG_BUGON(1); - ret = -EIO; + ret = -EFSCORRUPTED; goto out_unlock; /* xattr ondisk layout error */ } ret = -ENOATTR; @@ -237,7 +238,7 @@ static int xattr_foreach(struct xattr_iter *it, /* xattr on-disk corruption: xattr entry beyond xattr_isize */ if (unlikely(*tlimit < entry_sz)) { DBG_BUGON(1); - return -EIO; + return -EFSCORRUPTED; } *tlimit -= entry_sz; } |