<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:37:16 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-10681] Disable tiny writes for O_APPEND</title>
                <link>https://jira.whamcloud.com/browse/LU-10681</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Unfortunately, tiny writes will not work correctly with O_APPEND.  In short, this is because O_APPEND depends on LDLM locking to EOF (on all stripes/components) to protect the file size, but tiny writes requires only that the page we are writing to be locked.&lt;/p&gt;

&lt;p&gt;This means the LDLM lock on a stripe not containing this page could be granted to another client and that client could extend the file without revoking our lock.&lt;/p&gt;

&lt;p&gt;The simplest example is in a multiple stripes situation, but it could happen in a single stripe situation.&lt;/p&gt;

&lt;p&gt;Client 1 writes to a page on stripe 1, dirtying it.  File size is, for example, 2K.  (not O_APPEND)&lt;br/&gt;
Client 2 writes to some part of the file on stripe 2, file size is now 1 MB + 2K.  (not O_APPEND)&lt;br/&gt;
Client 1 does an O_APPEND write of 1K.  The tiny writes code notices the page at expected file size is present, locks the full file &lt;b&gt;locally&lt;/b&gt;, checks the size, notices it is 2K (because that&apos;s the locally known size) and writes there.&lt;/p&gt;

&lt;p&gt;Data is not in the correct location.  Ouch.&lt;/p&gt;

&lt;p&gt;Two possible fixes:&lt;br/&gt;
1. Don&apos;t do tiny writes with O_APPEND&lt;br/&gt;
2. Do some sort of glimpse before every write&lt;br/&gt;
^-- This almost certainly removes the point of doing tiny writes, because it would be so slow.  Better to do normal writes and take the full file locks required.&lt;/p&gt;

&lt;p&gt;One further thought:&lt;br/&gt;
We could arrange for the size update code for tiny writes to check if the client has LDLM locks to EOF.  If it is verified to have them after the start of the tiny write, we can be sure the file size on our client is up to date, or at least that it is not older than the start of the current write.  This would &lt;b&gt;still&lt;/b&gt; be faster than the normal write path, but much less than normal tiny writes.&lt;/p&gt;

&lt;p&gt;I&apos;ll submit a patch.  I will probably stick with the simplest solution - Don&apos;t do tiny writes for O_APPEND.  I will explore the test locking option, but that may be a little complicated, and the more complicated the tiny writes code gets, the less benefit it has.&lt;/p&gt;

&lt;p&gt;Note this problem is likely to be hit in the real world because O_APPEND writes are very often small.&lt;/p&gt;</description>
                <environment></environment>
        <key id="50859">LU-10681</key>
            <summary>Disable tiny writes for O_APPEND</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.whamcloud.com/images/icons/priorities/blocker.svg">Blocker</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="paf">Patrick Farrell</assignee>
                                    <reporter username="paf">Patrick Farrell</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Sun, 18 Feb 2018 05:00:54 +0000</created>
                <updated>Tue, 13 Mar 2018 15:47:31 +0000</updated>
                            <resolved>Thu, 8 Mar 2018 17:40:20 +0000</resolved>
                                    <version>Lustre 2.11.0</version>
                                    <fixVersion>Lustre 2.11.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>5</watches>
                                                                            <comments>
                            <comment id="221308" author="gerrit" created="Tue, 20 Feb 2018 17:58:16 +0000"  >&lt;p&gt;Patrick Farrell (paf@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/31353&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/31353&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10681&quot; title=&quot;Disable tiny writes for O_APPEND&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10681&quot;&gt;&lt;del&gt;LU-10681&lt;/del&gt;&lt;/a&gt;: Disable tiny writes for append&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6ff9be27f9c1dceeff2d44adcbe2de778db7bc8a&lt;/p&gt;</comment>
                            <comment id="222832" author="gerrit" created="Thu, 8 Mar 2018 17:35:50 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/31353/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/31353/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10681&quot; title=&quot;Disable tiny writes for O_APPEND&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10681&quot;&gt;&lt;del&gt;LU-10681&lt;/del&gt;&lt;/a&gt;: Disable tiny writes for append&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d79ffa3ff7461d8dcfb831f0024ed093a3f6f104&lt;/p&gt;</comment>
                            <comment id="222844" author="pjones" created="Thu, 8 Mar 2018 17:40:20 +0000"  >&lt;p&gt;Landed for 2.11&lt;/p&gt;</comment>
                            <comment id="223522" author="gerrit" created="Tue, 13 Mar 2018 15:47:31 +0000"  >&lt;p&gt;Minh Diep (minh.diep@intel.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/31633&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/31633&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10681&quot; title=&quot;Disable tiny writes for O_APPEND&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10681&quot;&gt;&lt;del&gt;LU-10681&lt;/del&gt;&lt;/a&gt;: Disable tiny writes for append&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_10&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 6708127aa2d747be0475d4bfabc8503e8ffcf43b&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|hzzsyn:</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>