shithub: lwext4

Download patch

ref: 29a5d255e429f73fbe44ac7c878fff3003474c88
parent: 9792c01efcf868269bab6cce4fa6efefcc1adcb6
author: ngkaho1234 <[email protected]>
date: Fri Oct 9 20:24:51 EDT 2015

FIX: list buffer size is not correctly returned on ext4_listxattr calls.

--- a/lwext4/ext4.c
+++ b/lwext4/ext4.c
@@ -2053,6 +2053,7 @@
 		if (prefix) {
 			memcpy(lxi->list_ptr, prefix, prefix_len);
 			lxi->list_ptr += prefix_len;
+			lxi->ret_size += prefix_len;
 		}
 		memcpy(lxi->list_ptr, item->name, item->name_len);
 		lxi->list_ptr[item->name_len] = 0;
@@ -2106,11 +2107,9 @@
 		r = ERANGE;
 
 	if (r == EOK) {
-		if (lxi.get_required_size) {
-			if (ret_size)
-				*ret_size = lxi.ret_size;
+		if (ret_size)
+			*ret_size = lxi.ret_size;
 
-		}
 	}
 	ext4_fs_put_xattr_ref(&xattr_ref);
 	ext4_fs_put_inode_ref(&inode_ref);