[PATCH 5/9] erofs-utils: lib: make the size of read data stored in buffer_ofs

Gao Xiang hsiangkao at linux.alibaba.com
Thu Dec 25 05:31:27 AEDT 2025


Source kernel commit: 5a8ffb1975c5b6511a996383fce7ad0f97132a5c

Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
---
 lib/xattr.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/xattr.c b/lib/xattr.c
index 4981944ff965..585908f61623 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -1369,7 +1369,7 @@ static int xattr_checkbuffer(struct erofs_xattr_iter *it,
 {
 	int err = it->buffer_size < value_sz ? -ERANGE : 0;
 
-	it->buffer_size = value_sz;
+	it->buffer_ofs = value_sz;
 	return !it->buffer ? 1 : err;
 }
 
@@ -1403,7 +1403,7 @@ static int inline_getxattr(struct erofs_inode *vi, struct erofs_xattr_iter *it)
 			break;
 	}
 
-	return ret ? ret : it->buffer_size;
+	return ret ? ret : it->buffer_ofs;
 }
 
 static int shared_getxattr(struct erofs_inode *vi, struct erofs_xattr_iter *it)
@@ -1426,7 +1426,7 @@ static int shared_getxattr(struct erofs_inode *vi, struct erofs_xattr_iter *it)
 			break;
 	}
 
-	return ret ? ret : it->buffer_size;
+	return ret ? ret : it->buffer_ofs;
 }
 
 int erofs_getxattr(struct erofs_inode *vi, const char *name, char *buffer,
-- 
2.43.5



More information about the Linux-erofs mailing list