Skip to contentSkip to conversation

erofs-utils: lib: Fix erofs_prepare_xattr_ibody() return value

PATCH New Gao Xiang 1 participant 1 message Jan 13 Library code

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs-utils: lib: Fix erofs_prepare_xattr_ibody() return value

It should return 0 on success, otherwise it breaks erofs_mkfs_handle_nondirectory().

Fixes edd57fffa738 ("erofs-utils: lib: delay erofs_prepare_xattr_ibody()")
---
 lib/inode.c | 4 ++--
 lib/xattr.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
lib/inode.c +2 -2
index d56e795d9cfe..26fefa25eddf 100644
@@ -1464,7 +1464,7 @@ static int erofs_mkfs_handle_nondirectory(const struct erofs_mkfs_btctx *btctx,
 
 	ret = erofs_prepare_xattr_ibody(inode,
 					btctx->incremental && IS_ROOT(inode));
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (S_ISLNK(inode->i_mode)) {
@@ -1503,7 +1503,7 @@ static int erofs_mkfs_create_directory(const struct erofs_mkfs_btctx *ctx,
 	int ret;
 
 	ret = erofs_prepare_xattr_ibody(inode, ctx->incremental && IS_ROOT(inode));
-	if (ret < 0)
+	if (ret)
 		return ret;
 
 	if (inode->datalayout == EROFS_INODE_DATALAYOUT_MAX) {
lib/xattr.c +1 -1
index 764aee3be3c3..703023703e53 100644
@@ -752,7 +752,7 @@ out:
 		return -ENOSPC;
 	}
 	inode->xattr_isize = ret;
-	return ret;
+	return 0;
 }
 
 static int erofs_count_all_xattrs_from_path(struct erofs_sb_info *sbi,
Signature · 1 line
2.43.5