<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:33:37 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-3403] error return value of listxattr when buffer is not large enough</title>
                <link>https://jira.whamcloud.com/browse/LU-3403</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;According to the standard, listxattr(2) should return -1 and errno should be set to ERANGE if the size of the list buffer is too small to hold the result. However ll_listxattr() will return a value bigger than the size of buffer in some cases.&lt;/p&gt;

&lt;p&gt;Let&apos;s assume listxattr(2) returns SIZE when it is called with a large enough list buffer. If it&apos;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 believe it is not a correct result.&lt;/p&gt;

&lt;p&gt;Attached file &apos;read_xattr.c&apos; is the code which can reproduce the problem. It runs perfectly on normal file system, but fails on Lustre.&lt;/p&gt;

&lt;p&gt;Attached file &apos;listxattr.patch&apos; is the patch that fixed the problem. The program of &apos;read_xattr.c&apos; runs well when the patch is applied.&lt;/p&gt;</description>
                <environment></environment>
        <key id="19164">LU-3403</key>
            <summary>error return value of listxattr when buffer is not large enough</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="keith">Keith Mannthey</assignee>
                                    <reporter username="lixi">Li Xi</reporter>
                        <labels>
                            <label>client</label>
                            <label>patch</label>
                    </labels>
                <created>Mon, 27 May 2013 13:13:32 +0000</created>
                <updated>Wed, 16 Oct 2013 01:28:00 +0000</updated>
                            <resolved>Wed, 16 Oct 2013 01:28:00 +0000</resolved>
                                    <version>Lustre 2.3.0</version>
                    <version>Lustre 1.8.9</version>
                                    <fixVersion>Lustre 2.5.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="59378" author="pjones" created="Mon, 27 May 2013 13:30:04 +0000"  >&lt;p&gt;Hi Li Xi&lt;/p&gt;

&lt;p&gt;I know that you are familiar with gerrit because I saw you upload a patch there recently. Please can you upload any patches you would like us to review into gerrit? This both allows our automated testing to verify the patch and also serves as the signoff permission for us to land the patch into the Lustre tree.&lt;/p&gt;


&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;

&lt;p&gt;PS/ Also, I am unclear why you have marked this as a blocker. Could you please elaborate?&lt;/p&gt;</comment>
                            <comment id="59382" author="lixi" created="Mon, 27 May 2013 13:44:33 +0000"  >&lt;p&gt;Hi Peter,&lt;/p&gt;

&lt;p&gt;Sure. I&apos;m pushing the patch to the gerrit. It will be finished soon.&lt;/p&gt;

&lt;p&gt;And I&apos;m sorry if the &apos;blocker&apos; option bothers you. The bug affected an application months ago. But we walked aroud it. So I&apos;d like to change it if it&apos;s possible to.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br/&gt;
Li Xi&lt;/p&gt;</comment>
                            <comment id="59383" author="pjones" created="Mon, 27 May 2013 13:49:22 +0000"  >&lt;p&gt;ok thanks li xi!&lt;/p&gt;</comment>
                            <comment id="59387" author="lixi" created="Mon, 27 May 2013 14:26:27 +0000"  >&lt;p&gt;I&apos;ve pushed the patch into gerrit. &lt;a href=&quot;http://review.whamcloud.com/#change,6463&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#change,6463&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="59389" author="pjones" created="Mon, 27 May 2013 15:14:37 +0000"  >&lt;p&gt;Thanks Li Xi!&lt;/p&gt;

&lt;p&gt;Keith&lt;/p&gt;

&lt;p&gt;Can you please review this patch and in particular whether a similar issue exists on master&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="59501" author="keith" created="Wed, 29 May 2013 03:28:33 +0000"  >&lt;p&gt;Perhaps we can add this test as well. How should your program be used to detect this error?&lt;/p&gt;</comment>
                            <comment id="59502" author="lixi" created="Wed, 29 May 2013 03:45:11 +0000"  >&lt;p&gt;We can use the test program like this:&lt;/p&gt;

&lt;p&gt;gcc read_xattr.c -o read_xattr&lt;br/&gt;
./read_xattr /mnt/lustre/some_file&lt;/p&gt;

&lt;p&gt;When it is run on Lustre without the fix patch, it will compain and exit. When it is run on Lustre with the patch, everything is OK.&lt;/p&gt;</comment>
                            <comment id="60211" author="keith" created="Sat, 8 Jun 2013 05:00:30 +0000"  >&lt;p&gt;I have added a test for this issue. It is dependant on the fix. &lt;/p&gt;

&lt;p&gt;It can be seen here: &lt;a href=&quot;http://review.whamcloud.com/6594&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/6594&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="69058" author="jlevi" created="Wed, 16 Oct 2013 01:28:00 +0000"  >&lt;p&gt;Patches have landed to Master. Please let me know if more work is needed in this ticket and I will reopen.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="12940" name="listxattr.patch" size="545" author="lixi" created="Mon, 27 May 2013 13:13:32 +0000"/>
                            <attachment id="12939" name="read_xattr.c" size="1072" author="lixi" created="Mon, 27 May 2013 13:13:32 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzvrx3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8420</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>