<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:40:17 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-11024] Broken inode accounting of MDT on ZFS</title>
                <link>https://jira.whamcloud.com/browse/LU-11024</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Roughly 6,200 10MB files are created with &apos;dd&apos; loop:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt; for i in `seq 1 10000` ; do dd if=/dev/zero of=file-$i bs=1M count=10; done&lt;br/&gt;
^C&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;All files were written to MDT index 0.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt;$ lfs getstripe &lt;del&gt;m file&lt;/del&gt;* | sort | uniq&lt;br/&gt;
0&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt;$ ls &lt;del&gt;1 file&lt;/del&gt;* | wc -l&lt;br/&gt;
6208&lt;/p&gt;

&lt;p&gt;So at this point, POSIX says I have 6,208 files named file-*.&lt;br/&gt;
Lustre however, reports the numbers differently.&lt;/p&gt;


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt;$ lfs quota -u 415432 /mnt/slate&lt;br/&gt;
Disk quotas for usr 415432 (uid 415432):&lt;br/&gt;
 Filesystem kbytes quota limit grace files quota limit grace&lt;br/&gt;
 /mnt/slate 61619203 0 0 - 1473 0 0 -&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;thcrowe@td-mngt01 thcrowe&amp;#93;&lt;/span&gt;$&lt;/p&gt;

&lt;p&gt;Here is the same data directly from the MDT&lt;/p&gt;


&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# grep -A1 415432 /proc/fs/lustre/osd-zfs/slate-MDT0000/quota_slave/acct_user&lt;/p&gt;
&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;id: 415432&lt;br/&gt;
 usage: { inodes: 1473, kbytes: 53825 }&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;#&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Following commands were used to dump MDT index 0&apos;s zfs contents:&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# zpool list&lt;br/&gt;
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT&lt;br/&gt;
mgs 186G 6.35M 186G - 0% 0% 1.00x ONLINE -&lt;br/&gt;
slate_mdt0000 8.67T 16.1G 8.66T - 0% 0% 1.00x ONLINE -&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# zpool set cachefile=/tmp/slate_mdt0000.cache slate_mdt0000&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# cp /tmp/slate_mdt0000.cache /tmp/slate_mdt0000.cache1&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# zpool set cachefile=&quot;&quot; slate_mdt0000&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# zdb -ddddd -U /tmp/slate_mdt0000.cache1 slate_mdt0000 &amp;gt; /tmp/slate_mdt0000-zdb-ddddd&lt;/p&gt;

&lt;p&gt;Once the zdb completed it output, it is a simple grep to see what uid 415432 has going on.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;root@slate-mds01 ~&amp;#93;&lt;/span&gt;# grep uid /tmp/slate_mdt0000-zdb-ddddd | grep -c 415432&lt;br/&gt;
6210&lt;/p&gt;

&lt;p&gt;6210 is not 6208, because there are 2 directory objects owned by 415432 in the zdb output.&lt;/p&gt;

&lt;p&gt;Further tests were run to check /proc/fs/lustre/osd-zfs/slate-MDT0000/quota_slave/acct_user reported correct information. If created 100 files, the account number increased from 120 to 205, and if created 1000 files, the account number increased from 120 to 929.&lt;/p&gt;

&lt;p&gt;Space accounting on MDT works well.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="52074">LU-11024</key>
            <summary>Broken inode accounting of MDT on ZFS</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="yong.fan">nasf</assignee>
                                    <reporter username="lixi">Li Xi</reporter>
                        <labels>
                            <label>llnl</label>
                    </labels>
                <created>Wed, 2 May 2018 02:05:27 +0000</created>
                <updated>Mon, 28 May 2018 02:11:00 +0000</updated>
                            <resolved>Mon, 21 May 2018 17:38:31 +0000</resolved>
                                                    <fixVersion>Lustre 2.12.0</fixVersion>
                    <fixVersion>Lustre 2.10.4</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>12</watches>
                                                                            <comments>
                            <comment id="227079" author="adilger" created="Wed, 2 May 2018 07:56:52 +0000"  >&lt;p&gt;What version of ZFS and Lustre is installed on the MDS?&#160; Using ZFS 0.6 had a Lustre-specific inode accounting implementation, but that was replaced with an in-ZFS dnode accounting mechanism in ZFS 0.7.&lt;/p&gt;</comment>
                            <comment id="227208" author="pjones" created="Thu, 3 May 2018 17:25:27 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=lixi&quot; class=&quot;user-hover&quot; rel=&quot;lixi&quot;&gt;lixi&lt;/a&gt; which Lustre version is being used here?&lt;/p&gt;</comment>
                            <comment id="227298" author="lixi" created="Fri, 4 May 2018 06:39:19 +0000"  >&lt;p&gt;The ZFS version is 0.7.5, and userobj_accounting feature is running actively on ZFS. The Lustre version is 2.10.3.&lt;/p&gt;</comment>
                            <comment id="227954" author="adilger" created="Wed, 16 May 2018 07:54:16 +0000"  >&lt;p&gt;This looks like it is a bug in the autoconf checking for ZFS dnode accounting introduced by the landing of patch &lt;a href=&quot;https://review.whamcloud.com/30540&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/30540&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7991&quot; title=&quot;Add project quota for ZFS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7991&quot;&gt;&lt;del&gt;LU-7991&lt;/del&gt;&lt;/a&gt; quota: project quota against ZFS backend&lt;/tt&gt;&quot; to b2_10 (patch &lt;a href=&quot;https://review.whamcloud.com/27093&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/27093&lt;/a&gt; on master).&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;diff --git a/config/lustre-build-zfs.m4 b/config/lustre-build-zfs.m4
index 9e39c80..297e790 100644
--- a/config/lustre-build-zfs.m4
+++ b/config/lustre-build-zfs.m4
@@ -523,10 +523,10 @@ your distribution.
                dnl # ZFS 0.7.0 feature: SPA_FEATURE_USEROBJ_ACCOUNTING
                dnl #
                LB_CHECK_COMPILE([&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; zfs has &lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; dnode accounting supported],
-               dmu_objset_userobjspace_upgrade, [
+               dmu_objset_id_quota_upgrade, [
                        #include &amp;lt;sys/dmu_objset.h&amp;gt;
                ],[
-                       dmu_objset_userobjspace_upgrade(NULL);
+                       dmu_objset_id_quota_upgrade(NULL);
                ],[
                        AC_DEFINE(HAVE_DMU_USEROBJ_ACCOUNTING, 1,
                                [Have &lt;span class=&quot;code-keyword&quot;&gt;native&lt;/span&gt; dnode accounting in ZFS])
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In particular, the &lt;tt&gt;dmu_objset_id_quota_upgrade()&lt;/tt&gt; function only exists in ZFS master (for 0.8), while &lt;tt&gt;dmu_objset_userobjspace_upgrade()&lt;/tt&gt; is what exists in ZFS 0.7.  We need to check for both.  Lustre doesn&apos;t call this function directly (that would cause the on-disk format to be changed and prevent downgrade to an older ZFS release), so we don&apos;t need any compatibility functions in Lustre, just the detection needs to be fixed.&lt;/p&gt;</comment>
                            <comment id="227967" author="yong.fan" created="Wed, 16 May 2018 13:20:20 +0000"  >&lt;p&gt;Here is the patch:&lt;br/&gt;
&lt;a href=&quot;https://review.whamcloud.com/#/c/32418/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/32418/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="227981" author="gerrit" created="Wed, 16 May 2018 15:33:01 +0000"  >&lt;p&gt;Andreas Dilger (andreas.dilger@intel.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32422&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32422&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11024&quot; title=&quot;Broken inode accounting of MDT on ZFS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11024&quot;&gt;&lt;del&gt;LU-11024&lt;/del&gt;&lt;/a&gt; osd-zfs: properly detect ZFS dnode accounting&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_10&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 3a4677a73c885035e48d4aabeefa2592596a64fd&lt;/p&gt;</comment>
                            <comment id="228031" author="adilger" created="Wed, 16 May 2018 20:12:21 +0000"  >&lt;p&gt;Note that this bug caused the ZFS dnode/inode quota to be reported incorrectly by Lustre - it wasn&apos;t using the DMU interface for reporting the dnode quota, but had fallen back to estimating dnode usage based on the user&apos;s space usage as if using ZFS 0.6.x which didn&apos;t have that interface.  ZFS was still accounting the dnode usage correctly internally.  Once the autoconf patch is applied and the Lustre server is rebuilt/restarted, then the ZFS dnode/inode quota will be reported correctly to Lustre.&lt;/p&gt;</comment>
                            <comment id="228156" author="gerrit" created="Fri, 18 May 2018 17:47:59 +0000"  >&lt;p&gt;John L. Hammond (john.hammond@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/32422/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32422/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11024&quot; title=&quot;Broken inode accounting of MDT on ZFS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11024&quot;&gt;&lt;del&gt;LU-11024&lt;/del&gt;&lt;/a&gt; osd-zfs: properly detect ZFS dnode accounting&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_10&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 71943a5d23498fc76d621e3855d580ff90f0757a&lt;/p&gt;</comment>
                            <comment id="228247" author="gerrit" created="Mon, 21 May 2018 16:51:34 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/32418/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32418/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11024&quot; title=&quot;Broken inode accounting of MDT on ZFS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11024&quot;&gt;&lt;del&gt;LU-11024&lt;/del&gt;&lt;/a&gt; osd-zfs: properly detect ZFS dnode accounting&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 4813eee9b06f6ceb4f39cce42d904ec1516a824a&lt;/p&gt;</comment>
                            <comment id="228266" author="pjones" created="Mon, 21 May 2018 17:38:32 +0000"  >&lt;p&gt;Landed for 2.12&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="35896">LU-7991</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="26634">LU-5638</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="46437">LU-9592</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|hzzwnz:</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>