<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:28:29 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-9702] mdt: Is mdt_attr_get_complex() behaving as expected?</title>
                <link>https://jira.whamcloud.com/browse/LU-9702</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Here is a &lt;b&gt;simplified&lt;/b&gt; version of &lt;tt&gt;mdt_attr_get_complex()&lt;/tt&gt;:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;int mdt_attr_get_complex(struct mdt_attr *ma)
{
    int need = ma-&amp;gt;ma_need;

    ma-&amp;gt;ma_valid = 0;

    if (need &amp;amp; MA_&amp;lt;something&amp;gt;) {
        ma-&amp;gt;ma_need = MA_&amp;lt;something&amp;gt;;
        mo_attr_get(ma);
    }

    return 0;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Is it normal/necessary for &lt;tt&gt;mdt_attr_get_complex()&lt;/tt&gt; to initialize &lt;tt&gt;ma-&amp;gt;ma_valid&lt;/tt&gt; to 0 whenever it is called?&lt;/p&gt;

&lt;p&gt;From what I understand, &lt;tt&gt;mdt_attr_get_complex()&lt;/tt&gt; is used to update cached attributes. When an attribute is updated, the field &lt;tt&gt;ma_valid&lt;/tt&gt; is modified to contain the corresponding &lt;tt&gt;MA_*&lt;/tt&gt; flag (MA_INODE, MA_HSM, ...).&lt;/p&gt;

&lt;p&gt;The problem I see with this, is that when &lt;tt&gt;mdt_attr_get_complex()&lt;/tt&gt; is called to only update inode attributes, hsm attributes will automatically get invalidated, without re-checking them. Is this the correct behaviour? Shouldn&apos;t &lt;tt&gt;ma_valid&lt;/tt&gt; be initialized to only clear the flags that the caller requested to re-check? Something like:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;ma-&amp;gt;ma_valid ~= ~need
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This issue was raised in a discussion on &lt;a href=&quot;https://review.whamcloud.com/#/c/27564/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this patch&lt;/a&gt; and might be the root cause of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-9654&quot; title=&quot;fix problem of Remove Archive on Last Unlink policy&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-9654&quot;&gt;&lt;del&gt;LU-9654&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="46812">LU-9702</key>
            <summary>mdt: Is mdt_attr_get_complex() behaving as expected?</summary>
                <type id="9" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/undefined.png">Question/Request</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</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="jhammond">John Hammond</assignee>
                                    <reporter username="cealustre">CEA</reporter>
                        <labels>
                    </labels>
                <created>Thu, 22 Jun 2017 11:19:43 +0000</created>
                <updated>Wed, 5 Aug 2020 13:55:24 +0000</updated>
                            <resolved>Wed, 5 Aug 2020 13:55:24 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="199988" author="pjones" created="Thu, 22 Jun 2017 17:34:22 +0000"  >&lt;p&gt;John&lt;/p&gt;

&lt;p&gt;Could you please advise?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="199991" author="jhammond" created="Thu, 22 Jun 2017 17:37:18 +0000"  >&lt;p&gt;Hi Quentin,&lt;/p&gt;

&lt;p&gt;Yes, this is the expected behavior. Since this function is called in about 20 places it would take a lot of analysis to change it. I suggest that you try to work around this behavior.&lt;/p&gt;</comment>
                            <comment id="204901" author="jhammond" created="Wed, 9 Aug 2017 15:25:08 +0000"  >&lt;p&gt;&lt;a href=&quot;https://review.whamcloud.com/#/c/27564/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/27564/&lt;/a&gt; has landed so I think this can be closed. Quentin, please reopen if you think there&apos;s more to do here.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|hzzfjr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>