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

Fixes: edd57fffa738 ("erofs-utils: lib: delay erofs_prepare_xattr_ibody()")
Signed-off-by: Gao Xiang <[email protected]>
---
 lib/inode.c | 4 ++--
 lib/xattr.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/inode.c b/lib/inode.c
index d56e795d9cfe..26fefa25eddf 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -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) {
diff --git a/lib/xattr.c b/lib/xattr.c
index 764aee3be3c3..703023703e53 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -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,
-- 
2.43.5


Reply via email to