<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:50:22 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-5309] The `zfs userspace` command is broken on Lustre-ZFS-OST datasets</title>
                <link>https://jira.whamcloud.com/browse/LU-5309</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It looks as though the &lt;tt&gt;zfs userspace&lt;/tt&gt; command is completely broken on at least one of our ZFS datasets backing a Lustre OST running a Lustre 2.4.2 based release.&lt;/p&gt;

&lt;p&gt;Here&apos;s what &lt;tt&gt;zfs list&lt;/tt&gt; 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;# pilsner1 /root &amp;gt; zfs list -t all
NAME                          USED  AVAIL  REFER  MOUNTPOINT
pilsner1                     17.3T  46.9T    30K  /pilsner1
pilsner1/lsd-ost0            17.3T  46.9T  15.9T  /pilsner1/lsd-ost0
pilsner1/lsd-ost0@17jun2014  1.39T      -  10.6T  -
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;And here&apos;s what &lt;tt&gt;zfs userspace&lt;/tt&gt; 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;# pilsner1 /root &amp;gt; zfs userspace pilsner1/lsd-ost0@17jun2014
TYPE        NAME         USED  QUOTA                                            
POSIX User  &amp;lt;omitted&amp;gt;   21.5K   none                                               
POSIX User  &amp;lt;omitted&amp;gt;    118M   none                                               
POSIX User  &amp;lt;omitted&amp;gt;   6.49G   none                                               
POSIX User  &amp;lt;omitted&amp;gt;   72.1M   none                                               
POSIX User  &amp;lt;omitted&amp;gt;    725M   none
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is clearly broken, and according to Matt Ahrens:&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;&amp;lt;+mahrens&amp;gt; prakash: yeah, that pbpaste output looks wrong.  All the &quot;REFER&quot; space should be accounted for by &quot;zfs userspace&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Additionally, running that command on the dataset itself (as opposed to a snapshot) fails with an error:&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;# pilsner1 /root &amp;gt; zfs userspace pilsner1/lsd-ost0          
cannot get used/quota for pilsner1/lsd-ost0: dataset is busy
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This is not the case for filesystems mounted through the ZPL.&lt;/p&gt;</description>
                <environment></environment>
        <key id="25498">LU-5309</key>
            <summary>The `zfs userspace` command is broken on Lustre-ZFS-OST datasets</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="5">Cannot Reproduce</resolution>
                                        <assignee username="utopiabound">Nathaniel Clark</assignee>
                                    <reporter username="prakash">Prakash Surya</reporter>
                        <labels>
                            <label>llnl</label>
                    </labels>
                <created>Wed, 9 Jul 2014 16:08:08 +0000</created>
                <updated>Thu, 12 Feb 2015 18:03:16 +0000</updated>
                            <resolved>Thu, 12 Feb 2015 18:03:16 +0000</resolved>
                                    <version>Lustre 2.4.2</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="88629" author="jfc" created="Wed, 9 Jul 2014 18:39:05 +0000"  >&lt;p&gt;Nathaniel &amp;#8211; please review.&lt;br/&gt;
Thank you,&lt;br/&gt;
~ jfc.&lt;/p&gt;</comment>
                            <comment id="88634" author="utopiabound" created="Wed, 9 Jul 2014 19:20:17 +0000"  >&lt;p&gt;Referenced (REFER) space does not equal space used (USED) as reported by &quot;zfs userspace&quot;.  The latter reports the total space of all the blocks allocated where REFER is (according to the zfs man page) &quot; The amount of data that is accessible by this dataset, which may or may  not  be  shared with  other datasets in the pool&quot;.  Even in a small scale test on a fresh plain ZFS filesystem these numbers don&apos;t agree:&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;$ zpool create test /dev/volgrp/logvol
$ zfs create test/foo
$ mkdir /test/foo/user
$ chown user.user /mnt/foo/user
$ su user
$ echo blah &amp;gt; /mnt/foo/user/bar
$ exit
$ zfs list -pt all
zfs list -pt all 
NAME                       USED       AVAIL    REFER  MOUNTPOINT
test                     188416  1031610368    31744  /test
test/foo                  50688  1031610368    32256  /test/foo
$ zfs userspace -p test/foo
TYPE        NAME  USED  QUOTA
POSIX User  user  2560   none
POSIX User  root  1536   none
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So if they are supposed to agree, that isn&apos;t a Lustre issue.&lt;/p&gt;</comment>
                            <comment id="88648" author="prakash" created="Wed, 9 Jul 2014 21:11:59 +0000"  >&lt;p&gt;Well first off, the Lustre zfs-osd and ZFS on Linux ZPL are two completely separate interfaces to the underlying internals of ZFS. So even if the accounting was broken through the ZPL, that does not necessarily mean it&apos;s for the same reason as through the zfs-osd. So you can&apos;t simply write this off because you think the accounting is incorrect through the posix layer.&lt;/p&gt;

&lt;p&gt;And second, I don&apos;t think they&apos;re supposed to be exactly the same. I&apos;d have to study the code to better understand, though, since I&apos;m not very familiar with how the accounting fits together.&lt;/p&gt;

&lt;p&gt;Being off by a number of megabytes doesn&apos;t seem strange to me, being off by number of terabytes does seem strange. Through the ZPL, I see this on a new pool and filesystem:&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;[root@surya1-guest-1 ~]# zpool create -f tank /dev/vd{b,c,d}
[root@surya1-guest-1 ~]# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
tank    93K  23.4G    30K  /tank
[root@surya1-guest-1 ~]# dd if=/dev/urandom of=/tank/file1 bs=1M count=100 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1
[root@surya1-guest-1 ~]# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
tank   100M  23.3G   100M  /tank
[root@surya1-guest-1 ~]# zfs userspace tank
TYPE        NAME  USED  QUOTA
POSIX User  root  100M   none
[root@surya1-guest-1 ~]# zfs list -p
NAME       USED        AVAIL      REFER  MOUNTPOINT
tank  105055232  25063914496  104970752  /tank
[root@surya1-guest-1 ~]# zfs userspace tank -p
TYPE        NAME       USED  QUOTA
POSIX User  root  104942080   none
[root@surya1-guest-1 ~]# echo 104970752-104942080 | bc
28672
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s a difference of exactly 28KB. This is in contrast to the example in the description, where the difference is over 10 TB.&lt;/p&gt;

&lt;p&gt;I believe the &lt;tt&gt;zfs_space_delta_cb&lt;/tt&gt; performs this space accounting tracking in the ZPL, and I would not be surprised if we never implemented equivalent functionality for the zfs-osd.&lt;/p&gt;</comment>
                            <comment id="88701" author="utopiabound" created="Thu, 10 Jul 2014 15:01:18 +0000"  >&lt;p&gt;Running a similar test on a fresh osd-zfs backed lustre filesystem I also get equivalent accounting as you did (this is with lustre master build 2553 and zfs/spl 0.6.3).&lt;/p&gt;

&lt;p&gt;I will double check Lustre 2.4.3 and zfs/spl 0.6.1.&lt;/p&gt;</comment>
                            <comment id="88724" author="prakash" created="Thu, 10 Jul 2014 16:56:42 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Running a similar test on a fresh osd-zfs backed lustre filesystem I also get equivalent accounting as you did (this is with lustre master build 2553 and zfs/spl 0.6.3).&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Hmm... that&apos;s interesting because I get &quot;more expected&quot; results when running the &lt;tt&gt;zfs userspace&lt;/tt&gt; command against one of our osd-zfs filesystems backing our test filesystem.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I will double check Lustre 2.4.3 and zfs/spl 0.6.1.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Yea, perhaps there was issues with the earlier ZFS releases.. The production system I checked (and seemed &quot;broken&quot;) was formatted originally with a 2.4.0 based lustre release and zfs 0.6.2, IIRC. While the test filesystem was formatted with a lustre 2.4.2 based release and ZFS 0.6.3.&lt;/p&gt;</comment>
                            <comment id="89887" author="utopiabound" created="Wed, 23 Jul 2014 21:23:04 +0000"  >&lt;p&gt;I have not been able to reproduce this on Lustre 2.4.3 with zfs/spl 0.6.1, but it was a freshly formatted system, and I was just moving large files around to see if numbers matched.&lt;/p&gt;</comment>
                            <comment id="106827" author="jfc" created="Thu, 12 Feb 2015 18:03:16 +0000"  >&lt;p&gt;This is an old and not very critical bug and we have not been able to reproduce it.&lt;/p&gt;

&lt;p&gt;~ jfc.&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|hzwqyv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14835</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>