<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:02:56 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-13636] local agent on ldiskfs can introduce quota inconsistency on MDT</title>
                <link>https://jira.whamcloud.com/browse/LU-13636</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;There is a discrepancy spotted between group inode quota and consumption.&lt;br/&gt;
 for example in group &lt;tt&gt;smith&lt;/tt&gt; the &quot;&lt;tt&gt;lfs quota status&lt;/tt&gt;&quot; shows:&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;Disk quotas for grp smith (gid 6789):
       Filesystem   kbytes     quota     limit   grace   files   quota   limit   grace
         /scratch 54380276  75497472 150994944       -  224737  264000  328000       -
scr1-MDT0000_UUID    82304         -     93548       -   34053       -   34618       -
scr1-MDT0001_UUID        0         -    244364       -       0       -       0       -
scr1-MDT0002_UUID        0         -    241368       -       0       -   33369       -
scr1-MDT0003_UUID        0         -    242804       -       0       -       0       -
scr1-MDT0004_UUID        0         -    262144       -       0       -       0       -
scr1-MDT0005_UUID        0         -     49232       -       0       -    3092       -
scr1-MDT0006_UUID        0         -     65552       -       0       -    3077       -
scr1-MDT0007_UUID        0         -     65560       -       0       -    3079       -
scr1-MDT0008_UUID        0         -     65548       -       0       -    1028       -
scr1-MDT0009_UUID        0         -        60       -       0       -    1031       -
scr1-MDT000a_UUID        0         -        40       -       0       -    1028       -
scr1-MDT000b_UUID        0         -        20       -       0       -    1031       -
scr1-MDT000c_UUID        0         -        20       -       0       -       0       -
scr1-MDT000d_UUID   414392         -    424912       -  121483       -  122271       -
scr1-MDT000e_UUID    73636         -     87852       -   34085       -   34826       -
scr1-MDT000f_UUID    68160         -     82304       -   35116       -   36051       -
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;whereas the filesystem scan reveals only 73757 files exist under that group.&lt;/p&gt;

&lt;p&gt;similarly for another group &lt;tt&gt;jones&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;Disk quotas for grp jones (gid 5678):
       Filesystem     kbytes       quota      limit   grace   files   quota   limit   grace
         /scratch 1425241616  3670016000 7340032000       -  466507  684000 1368000       -
scr1-MDT0000_UUID          0           -          0       -       5       -    1029       -
scr1-MDT0001_UUID          0           -      65536       -       0       -    4096       -
scr1-MDT0002_UUID          0           -      52216       -       0       -   18733       -
scr1-MDT0003_UUID          0           -         88       -       0       -      22       -
scr1-MDT0004_UUID          0           -         28       -       0       -       7       -
scr1-MDT0005_UUID          0           -         28       -       0       -       7       -
scr1-MDT0006_UUID          0           -         20       -       0       -       5       -
scr1-MDT0007_UUID          0           -      65536       -       0       -    4096       -
scr1-MDT0008_UUID          0           -      65536       -       0       -       0       -
scr1-MDT0009_UUID          0           -      65536       -       0       -       0       -
scr1-MDT000a_UUID    1055284           -    1908948       -  296133       -  298943       -
scr1-MDT000b_UUID      88672           -    1068664       -   51046       -   53892       -
scr1-MDT000c_UUID      88688           -    1001728       -   48391       -   51229       -
scr1-MDT000d_UUID     163564           -    1202556       -   70924       -   73763       -
scr1-MDT000e_UUID          0           -          0       -       7       -    4102       -
scr1-MDT000f_UUID          0           -          0       -       1       -    1025       -
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;whereas consumption is 121687 files across filesystem, hence a difference of 344820.&lt;/p&gt;

&lt;p&gt;group dirs are striped on 4 MDTs.&lt;/p&gt;

&lt;p&gt;observations have been across more than a week.&lt;/p&gt;

&lt;p&gt;at the moment, group quota is bumped so user jobs don&apos;t run into disk quota exceeded errors.&lt;/p&gt;

&lt;p&gt;also the first MDT in the allocated set, always has more entries than the rest. a quick test with a group creating 100 4-way striped dirs and no files showed same behaviour:&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;  Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /scratch    3520       0       0       -     880       0       0       -
scr1-MDT0004    2008       -   65536       -     502       -    4096       -
scr1-MDT0005     504       -   65536       -     126       -    4096       -
scr1-MDT0006     504       -   65536       -     126       -    4096       -
scr1-MDT0007     504       -   65536       -     126       -    4096       -
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It looks like it is caused by the &quot;agent&quot; directory inode, which is created to track the remote striped directory inode in other MDTs,&lt;br/&gt;
 the &quot;agent&quot; inode is created with its parent directory gid,&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; struct inode *osd_create_local_agent_inode(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_env *env,
                                                  struct osd_device *osd,
                                                  struct osd_object *pobj,
                                                  &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct lu_fid *fid,
                                                  __u32 type,
                                                  struct thandle *th)
{
        ...
        local = ldiskfs_create_inode(oh-&amp;gt;ot_handle, pobj-&amp;gt;oo_inode, type,
                                     NULL);                              &amp;lt;----- it pass argument &lt;span class=&quot;code-quote&quot;&gt;&quot;owner&quot;&lt;/span&gt; as &lt;span class=&quot;code-quote&quot;&gt;&quot;NULL&quot;&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(local)) {
                CERROR(&lt;span class=&quot;code-quote&quot;&gt;&quot;%s: create local error %d\n&quot;&lt;/span&gt;, osd_name(osd),
                       (&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;)PTR_ERR(local));
                RETURN(local);
        }

        /*
         * restore i_gid in &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; S_ISGID is set, we will inherit S_ISGID and set
         * correct gid on remote file, not agent here
         */
        local-&amp;gt;i_gid = current_fsgid();                                  &amp;lt;----- restore to gid 0(ROOT)
        ldiskfs_set_inode_state(local, LDISKFS_STATE_LUSTRE_NOSCRUB);
        ...
}

struct inode *__ldiskfs_new_inode(handle_t *handle, struct inode *dir,
                               umode_t mode, &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct qstr *qstr,
                               __u32 goal, uid_t *owner, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; handle_type,
                               unsigned &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; line_no, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; nblocks)
{
        ...
        /*
         * Initalize owners and quota early so that we don&apos;t have to account
         * &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; quota initialization worst &lt;span class=&quot;code-keyword&quot;&gt;case&lt;/span&gt; in standard inode creating
         * transaction
         */
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (owner) {
                inode-&amp;gt;i_mode = mode;
                i_uid_write(inode, owner[0]);
                i_gid_write(inode, owner[1]);
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (test_opt(sb, GRPID)) {
                inode-&amp;gt;i_mode = mode;
                inode-&amp;gt;i_uid = current_fsuid();
                inode-&amp;gt;i_gid = dir-&amp;gt;i_gid;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
                inode_init_owner(inode, dir, mode);
        dquot_initialize(inode);
        ...
}

void inode_init_owner(struct inode *inode, &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct inode *dir,
                        umode_t mode)
{       
        inode-&amp;gt;i_uid = current_fsuid();
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (dir &amp;amp;&amp;amp; dir-&amp;gt;i_mode &amp;amp; S_ISGID) {           &amp;lt;---- create with the its parent directory GID
                inode-&amp;gt;i_gid = dir-&amp;gt;i_gid;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (S_ISDIR(mode))
                        mode |= S_ISGID;
        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
                inode-&amp;gt;i_gid = current_fsgid();
        inode-&amp;gt;i_mode = mode;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;ol&gt;
	&lt;li&gt;OSD create the agent inode with the argument &quot;owner&quot; as NULL&lt;/li&gt;
	&lt;li&gt;LDiskFS (ext4) create the inode, and set its GID as its parent&apos;s GID because its &quot;&lt;tt&gt;S_ISGID&lt;/tt&gt;&quot; is set.&lt;/li&gt;
	&lt;li&gt;OSD change the GID of the newly created agent inode to GID 0(ROOT), which is not tracked by the quota&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;then the quota usage in LDiskFS (ext4) is damaged.&lt;/p&gt;</description>
                <environment></environment>
        <key id="59457">LU-13636</key>
            <summary>local agent on ldiskfs can introduce quota inconsistency on MDT</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</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="bzzz">Alex Zhuravlev</assignee>
                                    <reporter username="bzzz">Alex Zhuravlev</reporter>
                        <labels>
                    </labels>
                <created>Fri, 5 Jun 2020 05:15:09 +0000</created>
                <updated>Sun, 30 Jan 2022 03:52:58 +0000</updated>
                            <resolved>Thu, 11 Mar 2021 05:05:56 +0000</resolved>
                                                    <fixVersion>Lustre 2.12.9</fixVersion>
                    <fixVersion>Lustre 2.15.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="272047" author="gerrit" created="Fri, 5 Jun 2020 05:17:55 +0000"  >&lt;p&gt;Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/38842&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38842&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; osd: create agent inode with explicit owner&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 624c8dd0538c9740073c3c3bd8790aae9edfd86a&lt;/p&gt;</comment>
                            <comment id="272058" author="gerrit" created="Fri, 5 Jun 2020 12:16:18 +0000"  >&lt;p&gt;Alex Zhuravlev (bzzz@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/38844&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38844&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; obdclass: drop nlink if directory is removed&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 0454c361ee965b23596e72a7f5f89775370cacad&lt;/p&gt;</comment>
                            <comment id="282947" author="gerrit" created="Thu, 22 Oct 2020 06:03:55 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/38842/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38842/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; osd: create agent inode with explicit owner&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 7805b45f1182ed21198c0cd2000ffe93b7de5340&lt;/p&gt;</comment>
                            <comment id="283261" author="gerrit" created="Mon, 26 Oct 2020 17:28:54 +0000"  >&lt;p&gt;Minh Diep (mdiep@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/40403&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40403&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; osd: create agent inode with explicit owner&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 913bd0278adeaeaef32a183303aa21b00bda3c36&lt;/p&gt;</comment>
                            <comment id="284069" author="gerrit" created="Tue, 3 Nov 2020 03:16:45 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/40403/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/40403/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; osd: create agent inode with explicit owner&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 492428ec2fdf3cdcc88d39821f6751ca77fbf8c6&lt;/p&gt;</comment>
                            <comment id="294473" author="gerrit" created="Wed, 10 Mar 2021 08:02:36 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/38844/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/38844/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; obdclass: drop nlink if directory is removed&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: c6d5c6606a38e2b550a81591935b0091faba4a2e&lt;/p&gt;</comment>
                            <comment id="294616" author="pjones" created="Thu, 11 Mar 2021 05:05:56 +0000"  >&lt;p&gt;Landed for 2.15&lt;/p&gt;</comment>
                            <comment id="309071" author="eaujames" created="Mon, 2 Aug 2021 15:12:21 +0000"  >&lt;p&gt;backport on b2_12: &lt;a href=&quot;https://review.whamcloud.com/44466&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44466&lt;/a&gt;&#160;(&quot;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; obdclass: drop nlink if directory is removed&quot;)&lt;/p&gt;</comment>
                            <comment id="324457" author="gerrit" created="Sun, 30 Jan 2022 03:41:38 +0000"  >&lt;p&gt;&quot;Oleg Drokin &amp;lt;green@whamcloud.com&amp;gt;&quot; merged in patch &lt;a href=&quot;https://review.whamcloud.com/44466/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/44466/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-13636&quot; title=&quot;local agent on ldiskfs can introduce quota inconsistency on MDT&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-13636&quot;&gt;&lt;del&gt;LU-13636&lt;/del&gt;&lt;/a&gt; obdclass: drop nlink if directory is removed&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 0594393491fe6b3550873a34dd5e55ea70142624&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                                        </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="61201">LU-14032</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <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|i0121j:</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>
                                                                                            <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>