<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:26:53 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-2634] short symlinks on MDT with &quot;extents&quot; have EXT4_EXTENTS_FL set</title>
                <link>https://jira.whamcloud.com/browse/LU-2634</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Short symlinks on MDT filesystems formatted with the &quot;extents&quot; feature appear to be created with the EXT4_EXTENTS_FL in osd-ldiskfs, but that shouldn&apos;t be happening.  e2fsck considers this a corruption and deletes the symlink.&lt;/p&gt;

&lt;p&gt;While we have never formatted MDT filesystems with &quot;extents&quot; enabled, some users have done this, or enabled it after formatting, and the MDS should not corrupt such filesystems.&lt;/p&gt;</description>
                <environment>MDT needs to be formatted with {{--mkfsoptions=&amp;quot;-O extents&amp;quot;}}.  This is not a normal configuration, but has been seen in the field</environment>
        <key id="17208">LU-2634</key>
            <summary>short symlinks on MDT with &quot;extents&quot; have EXT4_EXTENTS_FL set</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="14249">LU-1366</parent>
                                    <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="emoly.liu">Emoly Liu</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>LB</label>
                    </labels>
                <created>Thu, 17 Jan 2013 13:46:33 +0000</created>
                <updated>Fri, 22 Mar 2013 20:18:24 +0000</updated>
                            <resolved>Mon, 18 Feb 2013 15:47:05 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                    <version>Lustre 2.1.2</version>
                    <version>Lustre 2.1.5</version>
                                    <fixVersion>Lustre 2.4.0</fixVersion>
                    <fixVersion>Lustre 2.1.5</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>7</watches>
                                                                            <comments>
                            <comment id="50855" author="emoly.liu" created="Sat, 19 Jan 2013 10:49:56 +0000"  >&lt;p&gt;I write a conf-sanity test for this case, but I can&apos;t reproduce the failure. No symlink error found by e2fsck if MDT is formatted with &quot;-O extents&quot;.&lt;br/&gt;
Andreas, could you please have a look if anything wrong in my script? Thanks.&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;test_72() { #LU-2634
        #enable &quot;-O extents&quot; to overwrite &quot;^extents&quot;
        local mdsdev=$(mdsdevname 1)
        local ostdev=$(ostdevname 1)
        add ${SINGLEMDS} $(mkfs_opts ${SINGLEMDS} ${mdsdev}) \
                --reformat --mkfsoptions=\\\&quot;-O extents\\\&quot; $mdsdev ||
                        error &quot;start mds with &quot;-O extents failed&quot;&quot;
        add ost1 $(mkfs_opts ost1 ${ostdev}) --reformat ${ostdev}
        start_mgsmds || error &quot;MDT start fail&quot;
        start_ost || error &quot;OST0 start fail&quot;
        mount_client $MOUNT || error &quot;Unable to mount client&quot;

        #create 100 short symlinks
        local fn=100
        mkdir -p $DIR/$tdir
        createmany -o $DIR/$tdir/$tfile-%d $fn || error &quot;create files failed&quot;
        echo &quot;create $fn short symlinks&quot;
        for i in $(seq -w 1 $fn); do
                ln -s $DIR/$tdir/$tfile-$i $MOUNT/$tfile-$i
        done

        #umount
        umount_client $MOUNT || error &quot;umount client failed&quot;
        stop_ost || error &quot;stop ost failed&quot;
        stop_mds || error &quot;stop mds failed&quot;

        #run e2fsck
        local cmd=&quot;$E2FSCK -fnvd $mdsdev&quot;
        local rc=0
        do_facet ${SINGLEMDS} $cmd || rc=$?
        echo &quot;$cmd return $rc&quot;
        [ $rc -gt 0 ] &amp;amp;&amp;amp; error &quot;e2fsck $rc errors found&quot;
        return $rc
}
run_test 72 &quot;Short symlink won&apos;t cause e2fsck error if MDT is formatted with extents enabled&quot;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is the output on my local machine.&lt;/p&gt;
&lt;div class=&quot;panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;panelContent&quot;&gt;
&lt;p&gt;== conf-sanity test 72: Short symlink won&apos;t cause e2fsck error if MDT is formatted with extents enabled == 01:53:26 (1358531606)&lt;br/&gt;
Loading modules from /root/master/lustre/tests/..&lt;br/&gt;
detected 2 online CPUs by sysfs&lt;br/&gt;
Force libcfs to create 2 CPU partitions&lt;br/&gt;
../libcfs/libcfs/libcfs options: &apos;cpu_npartitions=2 cpu_npartitions=2&apos;&lt;br/&gt;
debug=-1&lt;br/&gt;
subsystem_debug=all -lnet -lnd -pinger&lt;br/&gt;
gss/krb5 is not supported&lt;br/&gt;
quota/lquota options: &apos;hash_lqs_cur_bits=3&apos;&lt;/p&gt;

&lt;p&gt;   Permanent disk data:&lt;br/&gt;
Target:     lustre:MDT0000&lt;br/&gt;
Index:      0&lt;br/&gt;
Lustre FS:  lustre&lt;br/&gt;
Mount type: ldiskfs&lt;br/&gt;
Flags:      0x65&lt;br/&gt;
              (MDT MGS first_time update )&lt;br/&gt;
Persistent mount opts: user_xattr,errors=remount-ro&lt;br/&gt;
Parameters: sys.timeout=20 lov.stripesize=1048576 lov.stripecount=0 mdt.identity_upcall=/root/master/lustre/tests/../utils/l_getidentity&lt;/p&gt;

&lt;p&gt;formatting backing filesystem ldiskfs on /dev/loop0&lt;br/&gt;
	target name  lustre:MDT0000&lt;br/&gt;
	4k blocks     50000&lt;br/&gt;
	options        -I 512 -i 2048 -q -O &lt;font color=&quot;red&quot;&gt;extents&lt;/font&gt;,dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F&lt;br/&gt;
mkfs_cmd = mke2fs -j -b 4096 -L lustre:MDT0000  -I 512 -i 2048 -q -O extents,dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg -E lazy_journal_init -F /dev/loop0 50000&lt;br/&gt;
Writing CONFIGS/mountdata&lt;/p&gt;

&lt;p&gt;   Permanent disk data:&lt;br/&gt;
Target:     lustre:OST0000&lt;br/&gt;
Index:      0&lt;br/&gt;
Lustre FS:  lustre&lt;br/&gt;
Mount type: ldiskfs&lt;br/&gt;
Flags:      0x62&lt;br/&gt;
              (OST first_time update )&lt;br/&gt;
Persistent mount opts: errors=remount-ro&lt;br/&gt;
Parameters: mgsnode=10.211.55.7@tcp sys.timeout=20&lt;/p&gt;

&lt;p&gt;formatting backing filesystem ldiskfs on /dev/loop0&lt;br/&gt;
	target name  lustre:OST0000&lt;br/&gt;
	4k blocks     50000&lt;br/&gt;
	options        -I 256 -q -O extents,uninit_bg,dir_nlink,quota,huge_file,flex_bg -G 256 -E lazy_itable_init,resize=4290772992,lazy_journal_init -F&lt;br/&gt;
mkfs_cmd = mke2fs -j -b 4096 -L lustre:OST0000  -I 256 -q -O extents,uninit_bg,dir_nlink,quota,huge_file,flex_bg -G 256 -E lazy_itable_init,resize=4290772992,lazy_journal_init -F /dev/loop0 50000&lt;br/&gt;
Writing CONFIGS/mountdata&lt;br/&gt;
start mds service on centos6-3&lt;br/&gt;
Starting mds1:   -o loop /tmp/lustre-mdt1 /mnt/mds1&lt;br/&gt;
Started lustre-MDT0000&lt;br/&gt;
start ost1 service on centos6-3&lt;br/&gt;
Starting ost1:   -o loop /tmp/lustre-ost1 /mnt/ost1&lt;br/&gt;
Started lustre-OST0000&lt;br/&gt;
mount lustre on /mnt/lustre.....&lt;br/&gt;
Starting client: centos6-3: -o user_xattr,flock centos6-3@tcp:/lustre /mnt/lustre&lt;br/&gt;
total: 100 creates in 0.12 seconds: 801.81 creates/second&lt;br/&gt;
create 100 short symlinks&lt;br/&gt;
umount lustre on /mnt/lustre.....&lt;br/&gt;
Stopping client centos6-3 /mnt/lustre (opts&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.whamcloud.com/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;br/&gt;
stop ost1 service on centos6-3&lt;br/&gt;
Stopping /mnt/ost1 (opts:-f) on centos6-3&lt;br/&gt;
stop mds service on centos6-3&lt;br/&gt;
Stopping /mnt/mds1 (opts:-f) on centos6-3&lt;br/&gt;
e2fsck 1.42.3.wc3 (15-Aug-2012)&lt;br/&gt;
Pass 1: Checking inodes, blocks, and sizes&lt;br/&gt;
Pass 2: Checking directory structure&lt;br/&gt;
Pass 3: Checking directory connectivity&lt;br/&gt;
Pass 4: Checking reference counts&lt;br/&gt;
Pass 5: Checking group summary information&lt;/p&gt;

&lt;p&gt;     348 inodes used (0.35%)&lt;br/&gt;
       4 non-contiguous files (1.1%)&lt;br/&gt;
       1 non-contiguous directory (0.3%)&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;of inodes with ind/dind/tind blocks: 0/0/0&lt;br/&gt;
   16926 blocks used (33.85%)&lt;br/&gt;
       0 bad blocks&lt;br/&gt;
       1 large file&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;     192 regular files&lt;br/&gt;
      47 directories&lt;br/&gt;
       0 character device files&lt;br/&gt;
       0 block device files&lt;br/&gt;
       0 fifos&lt;br/&gt;
       6 links&lt;br/&gt;
     100 symbolic links (100 fast symbolic links)&lt;br/&gt;
       0 sockets&lt;br/&gt;
--------&lt;br/&gt;
     345 files&lt;br/&gt;
e2fsck -fnvd /tmp/lustre-mdt1 return 0&lt;br/&gt;
Resetting fail_loc on all nodes...done.&lt;br/&gt;
PASS 72 (37s)&lt;br/&gt;
== conf-sanity test complete, duration 64 sec == 01:54:03 (1358531643)&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="50856" author="emoly.liu" created="Sat, 19 Jan 2013 10:58:05 +0000"  >&lt;p&gt;Probably because option &quot;extents&quot; is in front of &quot;^extents&quot;?&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;-O extents,dirdata,uninit_bg,^extents,dir_nlink,quota,huge_file,flex_bg&lt;/p&gt;&lt;/blockquote&gt;</comment>
                            <comment id="50865" author="emoly.liu" created="Sun, 20 Jan 2013 20:38:23 +0000"  >&lt;p&gt;When I use --mkfsoptions=\\\&quot;-O ^extents,extents\\\&quot;, the error &quot;Fast symlink xxx has EXTENT_FL set.  Clear? no&quot; can be reproduced. &lt;/p&gt;</comment>
                            <comment id="50964" author="adilger" created="Tue, 22 Jan 2013 05:22:11 +0000"  >&lt;p&gt;Sorry, it seems mkfs.lustre works too hard to clear the &quot;extents&quot; option from the MDT feature list.  It could also be enabled with tune2fs after formatting.&lt;/p&gt;</comment>
                            <comment id="51071" author="emoly.liu" created="Wed, 23 Jan 2013 21:25:34 +0000"  >&lt;p&gt;Since the feature extents is disabled by default in current mkfs.lustre code, the patch only needs to fix the problem in the following two situations:&lt;br/&gt;
1. if the users still format MDT with &quot;-O extents&quot;, we will prevent setting EXT4_INODE_EXTENTS flag to the new fast symlink inodes;&lt;br/&gt;
2. if the users disable extents feature but the old data already have extents flag, we will clear EXT4_INODE_EXTENTS for the old fast symlink inodes and write back to disk to avoid e2fsck error.&lt;/p&gt;

&lt;p&gt;Now the patch can pass my local test for the above two situations. BTW, because the part of patch for situation 1 has avoided to set that extent flag for new inodes, it&apos;s hard to reproduce situation 2 in conf-sanity test. I simulate it manually and it works.&lt;/p&gt;</comment>
                            <comment id="51088" author="emoly.liu" created="Thu, 24 Jan 2013 04:29:41 +0000"  >&lt;p&gt;patch tracking at &lt;a href=&quot;http://review.whamcloud.com/5154&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5154&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="51190" author="adilger" created="Fri, 25 Jan 2013 03:19:30 +0000"  >&lt;p&gt;Looking at the ext4 code in the kernel, it shows something like:&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; ext4_symlink(struct inode *dir,
                        struct dentry *dentry, &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *symname)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (l &amp;lt; EXT4_N_BLOCKS * 4) {
                &lt;span class=&quot;code-comment&quot;&gt;/* clear the extent format &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fast symlink */&lt;/span&gt;
                ext4_clear_inode_flag(inode, EXT4_INODE_EXTENTS);
                inode-&amp;gt;i_op = &amp;amp;ext4_fast_symlink_inode_operations;
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It appears we should be doing the same thing in our own code:&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_writelink(struct inode *inode, &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *buffer, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; buflen)
 {
+        &lt;span class=&quot;code-comment&quot;&gt;/* clear the extent format &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; fast symlink */&lt;/span&gt;
+        ldiskfs_clear_inode_flag(inode, LDISKFS_INODE_EXTENTS);

         memcpy((&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *)&amp;amp;LDISKFS_I(inode)-&amp;gt;i_data, (&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *)buffer, buflen);
         LDISKFS_I(inode)-&amp;gt;i_disksize = buflen;
         i_size_write(inode, buflen);
         inode-&amp;gt;i_sb-&amp;gt;s_op-&amp;gt;dirty_inode(inode);

         &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0;
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="51294" author="emoly.liu" created="Sun, 27 Jan 2013 21:35:01 +0000"  >&lt;p&gt;Thanks for Andreas&apos; comment! I saw the code in ext4/ldiskfs_symlink(). Now I know my previous change to ext4/ldiskfs is not a right place. It should be fixed in lustre osd-ldiskfs level not ext4/ldiskfs level.&lt;/p&gt;

&lt;p&gt;BTW, I test the change above in osd_ldiskfs_writelink() and it works.&lt;/p&gt;</comment>
                            <comment id="52597" author="emoly.liu" created="Mon, 18 Feb 2013 03:41:57 +0000"  >&lt;p&gt;b2_1 port is at &lt;a href=&quot;http://review.whamcloud.com/5458&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/5458&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="52648" author="pjones" created="Mon, 18 Feb 2013 15:47:05 +0000"  >&lt;p&gt;Landed for 2.4&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="17194">LU-2627</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|hzvfjj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6163</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>