erofs_dev_read() will fill with zeroes so this issue has no functional
impact, but this behavior will be changed.

Fixes: f44043561491 ("erofs-utils: introduce fsck.erofs")
Signed-off-by: Gao Xiang <[email protected]>
---
 fsck/main.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/fsck/main.c b/fsck/main.c
index 44719b9..93de1cd 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -343,15 +343,12 @@ static int erofs_verify_xattr(struct erofs_inode *inode)
        if (inode->xattr_isize == xattr_hdr_size) {
                erofs_err("xattr_isize %d of nid %llu is not supported yet",
                          inode->xattr_isize, inode->nid | 0ULL);
-               ret = -EFSCORRUPTED;
-               goto out;
+               return -EOPNOTSUPP;
        } else if (inode->xattr_isize < xattr_hdr_size) {
-               if (inode->xattr_isize) {
-                       erofs_err("bogus xattr ibody @ nid %llu",
-                                 inode->nid | 0ULL);
-                       ret = -EFSCORRUPTED;
-                       goto out;
-               }
+               if (!inode->xattr_isize)
+                       return 0;
+               erofs_err("bogus xattr ibody @ nid %llu", inode->nid | 0ULL);
+               return -EFSCORRUPTED;
        }
 
        addr = erofs_iloc(inode) + inode->inode_isize;
-- 
2.43.5


Reply via email to