Hi,<br><br>I have a question about function ll_listxattr(). According to the standard, listxattr(2) should return -1if the size of the list buffer is too small to hold the result. However ll_listxattr() will return a value bigger than buffer size in some cases.<br>

<br>Let&#39;s assume listxattr(2) returns SIZE when it is called with a large enough list buffer. If it&#39;s called with a list buffer whose size is smaller than SIZE but bigger than SIZE-12, then listxattr(2) will return SIZE too. I got the result on Lustre-2.2. I believe it is not a correct result.<br>

<br>The following codes in ll_listxattr() causes this problem:<br><br> if (buffer &amp;&amp; (rc + total_len) &lt;= size) {<br> buffer += rc;<br> memcpy(buffer,XATTR_LUSTRE_PREFIX, prefix_len);<br>

 memcpy(buffer+prefix_len, &quot;lov&quot;, name_len);<br> buffer[prefix_len + name_len] = &#39;\0&#39;;<br> }<br> rc2 = total_len;<br><br>I think when &#39;(rc + total_len) &lt;= size&#39; is false and the buffer is not NULL, the return valuse should be set to -1.<br>

<br>Is that a problem or a feature?<br><br>Thanks,<br><br>Li Xi<br>