<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:21:39 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-8916] ods-zfs doesn&apos;t manage ZAP sizes correctly</title>
                <link>https://jira.whamcloud.com/browse/LU-8916</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;I mounted a ZFS backed lustre target thru the ZPL and it appears that ZAP sizes are not being adjusted as child objects are added or removed. Examples below.&lt;/p&gt;

&lt;p&gt;Looking at update_log_dir, performing a ls -l yields the following:&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;drw-r--r--. 2 root root&#160;&#160;&#160; 2 Dec 31&#160; 1969 update_log_dir

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But, that&apos;s wrong. We should be seeing a size of 3 as an ls shows us there are 3 children.&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;-bash-4.1# ls -a update_log_dir
.  ..  [0x200000400:0x1:0x0]

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Looking at oi.10, ls -l displays a size of 0:&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;drwxr-xr-x. 0 root root    0 Dec 31  1969 oi.10

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But, the size we should be seeing is 12 as per the ls below.&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;-bash-4.1# ls -a oi.10
.   0x20000000a:0x0:0x0  0xa:0x3:0x0  0xa:0x5:0x0  0xa:0x7:0x0  0xa:0x9:0x0
..  0xa:0x0:0x0          0xa:0x4:0x0  0xa:0x6:0x0  0xa:0x8:0x0  0xa:0xa:0x0

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;In the ZPL, the size of a directory should be the number of objects contained within it. The osd-zfs is clearly breaking that.&lt;/p&gt;

&lt;p&gt;As a practical use case, in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8753&quot; title=&quot;Recovery already passed deadline with DNE&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8753&quot;&gt;&lt;del&gt;LU-8753&lt;/del&gt;&lt;/a&gt;, we couldn&apos;t remove update_log_dir since the directory didn&apos;t qualify as empty with a size of 1. The ZPL expects an empty directory to have a size of 2 (for &apos;.&apos; and &apos;..&apos;).&lt;/p&gt;</description>
                <environment></environment>
        <key id="42278">LU-8916</key>
            <summary>ods-zfs doesn&apos;t manage ZAP sizes correctly</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="6">Not a Bug</resolution>
                                        <assignee username="bzzz">Alex Zhuravlev</assignee>
                                    <reporter username="dinatale2">Giuseppe Di Natale</reporter>
                        <labels>
                            <label>llnl</label>
                            <label>patch</label>
                    </labels>
                <created>Wed, 7 Dec 2016 18:03:55 +0000</created>
                <updated>Tue, 23 Jan 2018 17:56:12 +0000</updated>
                            <resolved>Mon, 22 Jan 2018 22:22:03 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="176895" author="dinatale2" created="Wed, 7 Dec 2016 18:10:30 +0000"  >&lt;p&gt;I&apos;ll be submitting a preliminary patch shortly. I also have a few questions I need help with.&lt;/p&gt;</comment>
                            <comment id="176896" author="gerrit" created="Wed, 7 Dec 2016 18:16:38 +0000"  >&lt;p&gt;Giuseppe Di Natale (dinatale2@llnl.gov) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/24207&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/24207&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8916&quot; title=&quot;ods-zfs doesn&amp;#39;t manage ZAP sizes correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8916&quot;&gt;&lt;del&gt;LU-8916&lt;/del&gt;&lt;/a&gt; osd-zfs: Correct ZAP size accounting&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 7f6def52b783a18225183e6aa5fdf7d3f5112295&lt;/p&gt;</comment>
                            <comment id="176903" author="ofaaland" created="Wed, 7 Dec 2016 18:29:08 +0000"  >&lt;p&gt;Note that the patch does not fix all cases.  Joe will submit questions as well.&lt;/p&gt;</comment>
                            <comment id="176912" author="pjones" created="Wed, 7 Dec 2016 18:53:40 +0000"  >&lt;p&gt;Nathaniel&lt;/p&gt;

&lt;p&gt;Could you please assist with this one?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="176963" author="adilger" created="Wed, 7 Dec 2016 21:45:13 +0000"  >&lt;p&gt;Note that the OIs are ZAPs, but are not strictly real directories because entries there do not increase the nlink count on the files/dirs that they are referencing.  I definitely agree that being able to view and possibly remove entries from the OI but if that also decrements the dnode link count then this could cause potential issues if unlinking FID files from the OI ZAP via ZPL mountpoint.&lt;/p&gt;</comment>
                            <comment id="176977" author="dinatale2" created="Wed, 7 Dec 2016 23:01:58 +0000"  >&lt;p&gt;I&apos;ve not been looking at the link count too closely yet. I was going to look at that bit later. I&apos;m strictly talking about the size of a directory as reported by ZPL. It is quite possible that I&apos;m missing part of the picture and I should start paying attention to the link count.&lt;/p&gt;</comment>
                            <comment id="177009" author="adilger" created="Thu, 8 Dec 2016 08:15:00 +0000"  >&lt;p&gt;The OI files explicitly do NOT track the link count themselves (for subdirectories) or on the referenced inodes (for regular files) in order to not upset the visible nlink counter on the inode under normal usage.&lt;/p&gt;</comment>
                            <comment id="191557" author="bzzz" created="Tue, 11 Apr 2017 17:52:57 +0000"  >&lt;p&gt;I measured the patch against zfs performance branch:&lt;br/&gt;
before:&lt;br/&gt;
mdt 1 file 3000000 dir   16 thr   16 create 306471.11 [ 240979.28, 357970.29] &lt;br/&gt;
after:&lt;br/&gt;
mdt 1 file 3000000 dir   16 thr   16 create 267600.94 [  999.97, 347099.55] &lt;/p&gt;

&lt;p&gt;going to present the result to ZFS guys ...&lt;/p&gt;</comment>
                            <comment id="192872" author="bzzz" created="Thu, 20 Apr 2017 16:05:12 +0000"  >&lt;p&gt;this is what Matt suggested:&lt;br/&gt;
1. Make Lustre not update SA_ZPL_SIZE.&lt;br/&gt;
2. Make the ZPL accept an incorrect SA_ZPL_SIZE without panicking.  The ZPL will set z_size based on zap_count(), rather than on SA_ZPL_SIZE.&lt;br/&gt;
3. To maintain backwards compatibility, make the ZPL continue to write an accurate SA_ZPL_SIZE (based on the z_size which will still be accurate due to (2).&lt;/p&gt;

&lt;p&gt;I&apos;ve been working on the patch to ZFS..&lt;/p&gt;</comment>
                            <comment id="192984" author="bzzz" created="Fri, 21 Apr 2017 09:34:51 +0000"  >&lt;p&gt;also, can you please clarify the last statement in the description:&lt;br/&gt;
As a practical use case, in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-8753&quot; title=&quot;Recovery already passed deadline with DNE&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-8753&quot;&gt;&lt;del&gt;LU-8753&lt;/del&gt;&lt;/a&gt;, we couldn&apos;t remove update_log_dir since the directory didn&apos;t qualify as empty with a size of 1. The ZPL expects an empty directory to have a size of 2 (for &apos;.&apos; and &apos;..&apos;).&lt;/p&gt;

&lt;p&gt;but we do set size to 2 for all regular directories (though don&apos;t update it):&lt;br/&gt;
    Object  lvl   iblk   dblk  dsize  lsize   %full  type&lt;br/&gt;
      3121    2   128K    16K  11.0K    32K  100.00  ZFS directory&lt;br/&gt;
                                        192   bonus  System attributes&lt;br/&gt;
        path    /ROOT/TOOR&lt;br/&gt;
        uid     0&lt;br/&gt;
        gid     0&lt;br/&gt;
        mode    40755&lt;br/&gt;
        size    2&lt;/p&gt;

&lt;p&gt;so you should be possible to remove with ZPL? but check for emptiness won&apos;t work correctly and I&apos;m going to fix this in ZPL as Matt suggested.&lt;/p&gt;</comment>
                            <comment id="205855" author="pjones" created="Mon, 21 Aug 2017 05:00:49 +0000"  >&lt;p&gt;AFAIK Alex is the one working on thos&lt;/p&gt;</comment>
                            <comment id="207362" author="bzzz" created="Mon, 4 Sep 2017 11:55:58 +0000"  >&lt;p&gt;a short update.. so with the uptodate ZFS (0.7) it&apos;s possible to remove such a directory. actually it&apos;s possible to remove non-empty directory as well (like CONFIGS/), which I guess is not very nice. as mentioned before, the suggested solution is to let ZFS check a counter in ZAP structure. &lt;br/&gt;
two options have been considered:&lt;br/&gt;
a) check ZAP&apos;s internal counter in zfs_dirempty() &amp;#8211; Matt was fine with that, but that would be extra cost to access that structure (dnode# -&amp;gt; dnode_t structure translation) or we&apos;d need to keep a reference to dnode_t in znode structure&lt;br/&gt;
b) wait until SA becomes less expensive, I believe there is a common wish to going this way&lt;/p&gt;</comment>
                            <comment id="208691" author="ofaaland" created="Mon, 18 Sep 2017 21:28:37 +0000"  >&lt;p&gt;Olaf to correspond with Alex to understand options better and decide what further work is necessary.&lt;/p&gt;</comment>
                            <comment id="213862" author="ofaaland" created="Thu, 16 Nov 2017 00:13:23 +0000"  >&lt;p&gt;Alex,&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;a) check ZAP&apos;s internal counter in zfs_dirempty() &#8211; Matt was fine with that, but that would be extra cost to access that structure (dnode# -&amp;gt; dnode_t structure translation) or we&apos;d need to keep a reference to dnode_t in znode structure&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;If the ZAP&apos;s internal counter is only consulted when &lt;em&gt;dzp-&amp;gt;z_size != 2&lt;/em&gt; then the cost is only paid when the rmdir would normally fail anyway, right? Or are you thinking of always checking both &lt;em&gt;dzp-&amp;gt;z_size&lt;/em&gt; and checking the ZAP&apos;s internal counter?&lt;/p&gt;

&lt;p&gt;Can you expand upon option (b) which I take it you prefer? It sounds like you have reason to think SAs will become cheaper to update and access. Is there in-progress work that will make that so? Thanks.&lt;/p&gt;</comment>
                            <comment id="214668" author="bzzz" created="Mon, 27 Nov 2017 14:05:02 +0000"  >&lt;p&gt;sorry for the late reply.&lt;br/&gt;
we can&apos;t consult with dzp-&amp;gt;z_size if we want to keep performance as cost of z_size maintainance is very high (due to SA expenses).&lt;br/&gt;
unfortunately to access ZAP&apos;s internal counter we have to lookup dnode_p* structure by dnode number (stored in znode), which isn&apos;t free. the good thing is that rmdir isn&apos;t that frequent operation. Ideally we should store dnode_p* in znode structure, I&apos;ll talk to Matt about this possibility. in the mean time I&apos;m going to have a patch adding that check for the internal counter. this should fix your issue with silent removal of non-empty directories, correct me If I&apos;m wrong please.&lt;/p&gt;</comment>
                            <comment id="217301" author="pjones" created="Tue, 2 Jan 2018 13:26:56 +0000"  >&lt;p&gt;I believe that &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=bzzz&quot; class=&quot;user-hover&quot; rel=&quot;bzzz&quot;&gt;bzzz&lt;/a&gt;&#160;has pushed a proposed change to ZoL - &lt;a href=&quot;https://github.com/zfsonlinux/zfs/pull/6987&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/zfsonlinux/zfs/pull/6987&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="218849" author="ofaaland" created="Mon, 22 Jan 2018 21:54:58 +0000"  >&lt;p&gt;ZoL PR 6987 was replaced with&lt;br/&gt;
&lt;a href=&quot;https://github.com/zfsonlinux/zfs/pull/7019&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/zfsonlinux/zfs/pull/7019&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;which was landed to ZoL master and queued for inclusion in zfs-0.7.6 when it is tagged.&lt;/p&gt;</comment>
                            <comment id="218851" author="pjones" created="Mon, 22 Jan 2018 22:22:03 +0000"  >&lt;p&gt;Fixed in ZFS&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="41010">LU-8753</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|hzyxrb:</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>