<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:00:40 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-6489] osd-ldiskfs checks s_maxbytes limits incorrectly</title>
                <link>https://jira.whamcloud.com/browse/LU-6489</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;See the !HAVE_LDISKFS_MAP_BLOCKS version of osd_ldiskfs_map_ext_inode_pages(). The extent_max_page_index comparison is not applied to the first page in the IO and IIUC the comparison should be against &lt;tt&gt;fp-&amp;gt;index + clen&lt;/tt&gt; rather than &lt;tt&gt;fp-&amp;gt;index + i&lt;/tt&gt;.&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; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; osd_ldiskfs_map_ext_inode_pages(struct inode *inode,
                                           struct page **page,
                                           &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; pages, unsigned &lt;span class=&quot;code-object&quot;&gt;long&lt;/span&gt; *blocks,
                                           &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; create)
{
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; blocks_per_page = PAGE_CACHE_SIZE &amp;gt;&amp;gt; inode-&amp;gt;i_blkbits;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; rc = 0, i = 0;
        struct page *fp = NULL;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; clen = 0;
        pgoff_t extent_max_page_index;

        extent_max_page_index = inode-&amp;gt;i_sb-&amp;gt;s_maxbytes &amp;gt;&amp;gt; PAGE_SHIFT;

        CDEBUG(D_OTHER, &lt;span class=&quot;code-quote&quot;&gt;&quot;inode %lu: map %d pages from %lu\n&quot;&lt;/span&gt;,
                inode-&amp;gt;i_ino, pages, (*page)-&amp;gt;index);

        /* pages are sorted already. so, we just have to find
         * contig. space and process them properly */
        &lt;span class=&quot;code-keyword&quot;&gt;while&lt;/span&gt; (i &amp;lt; pages) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fp == NULL) {
                        &lt;span class=&quot;code-comment&quot;&gt;/* start &lt;span class=&quot;code-keyword&quot;&gt;new&lt;/span&gt; extent */&lt;/span&gt;
                        fp = *page++;
                        clen = 1;
                        i++;
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fp-&amp;gt;index + clen == (*page)-&amp;gt;index) {
                        &lt;span class=&quot;code-comment&quot;&gt;/* &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt; the extent */&lt;/span&gt;
                        page++;
                        clen++;
                        i++;
                        &lt;span class=&quot;code-keyword&quot;&gt;continue&lt;/span&gt;;
                }

                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fp-&amp;gt;index + i &amp;gt;= extent_max_page_index)
                        GOTO(cleanup, rc = -EFBIG);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The other version of osd_ldiskfs_map_inode_pages() looks better but also uses &lt;tt&gt;i&lt;/tt&gt; instead of &lt;tt&gt;clen&lt;/tt&gt;.&lt;/p&gt;

&lt;p&gt;In practice this is OK because clients respect llli_maxbytes/lsm_maxbytes/ocd_maxbytes. If client checks are disabled then it&apos;s easy to submit IOs that exceed the 16T - 4K limits and cause LBUGs in osd_do_bio(). However dynamic layouts and HSM restore introduce TOCTTOU issues with lli_maxbytes based checks.&lt;/p&gt;</description>
                <environment></environment>
        <key id="29631">LU-6489</key>
            <summary>osd-ldiskfs checks s_maxbytes limits incorrectly</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="1">Fixed</resolution>
                                        <assignee username="ys">Yang Sheng</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>easy</label>
                            <label>osd-ldiskfs</label>
                    </labels>
                <created>Thu, 23 Apr 2015 20:16:02 +0000</created>
                <updated>Thu, 9 Jul 2015 01:38:50 +0000</updated>
                            <resolved>Thu, 9 Jul 2015 01:38:50 +0000</resolved>
                                    <version>Lustre 2.8.0</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="114732" author="gerrit" created="Fri, 8 May 2015 15:24:31 +0000"  >&lt;p&gt;Yang Sheng (yang.sheng@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/14731&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14731&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6489&quot; title=&quot;osd-ldiskfs checks s_maxbytes limits incorrectly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6489&quot;&gt;&lt;del&gt;LU-6489&lt;/del&gt;&lt;/a&gt; osd: check max_page_index correctly&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: f30a233260a67cca737a826504d00444c3c990b9&lt;/p&gt;</comment>
                            <comment id="120728" author="gerrit" created="Wed, 8 Jul 2015 17:20:35 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/14731/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14731/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6489&quot; title=&quot;osd-ldiskfs checks s_maxbytes limits incorrectly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6489&quot;&gt;&lt;del&gt;LU-6489&lt;/del&gt;&lt;/a&gt; osd-ldiskfs: check max_page_index correctly&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: e185617009748a94f6284920bb291670aee09e39&lt;/p&gt;</comment>
                            <comment id="120788" author="ys" created="Thu, 9 Jul 2015 01:38:50 +0000"  >&lt;p&gt;Patch landed. Close this ticket.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="20280">LU-3732</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|hzxbfz:</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>