A long-standing porting bug.

Fixes: c47df5aa2d16 ("erofs-utils: fuse: introduce xattr support")
Cc: Huang Jianan <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
---
 lib/xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/xattr.c b/lib/xattr.c
index 68236690d5b3..4ef27d446bb8 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -1637,7 +1637,7 @@ int erofs_listxattr(struct erofs_inode *vi, char *buffer, 
size_t buffer_size)
        it.buffer_ofs = 0;
 
        ret = inline_listxattr(vi, &it);
-       if (ret < 0 && ret != -ENOATTR)
+       if (ret >= 0 || ret == -ENOATTR)
                ret = shared_listxattr(vi, &it);
        erofs_put_metabuf(&it.it.buf);
        return ret;
-- 
2.43.5


Reply via email to