Skip to contentSkip to conversation

erofs-utils: fsck: skip erofs_verify_xattr() if xattr_isize is 0

PATCH New Gao Xiang 1 participant 1 message Aug 5, 2025

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: fsck: skip erofs_verify_xattr() if xattr_isize is 0

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")
---
 fsck/main.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
fsck/main.c +5 -8
index 44719b9..93de1cd 100644
@@ -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;
Signature · 1 line
2.43.5