<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:55:21 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-12755] CPU soft lockup on mkfs.lustre</title>
                <link>https://jira.whamcloud.com/browse/LU-12755</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;After successfully creating packages for Red Hat 7.7&lt;/p&gt;

&lt;p&gt;(e.g. lustre-2.12.57_35_g55a7e2d-1.el7.x86_64.rpm)&lt;/p&gt;

&lt;p&gt;I get CPU soft lockups when&#160;trying&#160;to create an MGS with LDISKFS backend.&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;NMI watchdog: BUG: soft lockup - CPU#1 stuck for 22s! [mkfs.lustre:31220]&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;More details from log:&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;Sep  6 10:41:00 mgs1 kernel: Call Trace:Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9bd73365&amp;gt;] queued_spin_lock_slowpath+0xb/0xf
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9bd81ad0&amp;gt;] _raw_spin_lock+0x20/0x30
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b865e2e&amp;gt;] igrab+0x1e/0x60
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffffc06bd88b&amp;gt;] ldiskfs_quota_off+0x3b/0x130 [ldiskfs]
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffffc06c091d&amp;gt;] ldiskfs_put_super+0x4d/0x400 [ldiskfs]
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b84b13d&amp;gt;] generic_shutdown_super+0x6d/0x100
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b84b5b7&amp;gt;] kill_block_super+0x27/0x70
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b84b91e&amp;gt;] deactivate_locked_super+0x4e/0x70
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b84c0a6&amp;gt;] deactivate_super+0x46/0x60
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b86abff&amp;gt;] cleanup_mnt+0x3f/0x80
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b86ac92&amp;gt;] __cleanup_mnt+0x12/0x20
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b6c1c0b&amp;gt;] task_work_run+0xbb/0xe0
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9b62cc65&amp;gt;] do_notify_resume+0xa5/0xc0
Sep  6 10:41:00 mgs1 kernel: [&amp;lt;ffffffff9bd8c23b&amp;gt;] int_signal+0x12/0x17
Sep  6 10:41:00 mgs1 kernel: Code: 47 fe ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5 66 90 b9 01 00 00 00 8b 17 85 d2 74 0d 83 fa 03 74 08 f3 90 &amp;lt;8b&amp;gt; 17 85 d2 75 f3 89 d0 f0 0f b1 0f 39 c2 75 e3 5d 66 90 c3 0f&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I also tried to go for an MDS/MGS pair on the DL380 but mkfs.lustre got stuck the same way&#160;&lt;/p&gt;

&lt;p&gt;as seen on VMware.&lt;/p&gt;</description>
                <environment>Red Hat 7.7 on VMware&lt;br/&gt;
Red Hat 7.7 on HPE ProLiant DL380 Gen10&lt;br/&gt;
Red Hat 7.7 on HPE Synergy 480 Gen10</environment>
        <key id="56899">LU-12755</key>
            <summary>CPU soft lockup on mkfs.lustre</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="yujian">Jian Yu</assignee>
                                    <reporter username="kazinczy">Tamas Kazinczy</reporter>
                        <labels>
                            <label>hang</label>
                            <label>mkfs.lustre</label>
                    </labels>
                <created>Thu, 12 Sep 2019 14:23:15 +0000</created>
                <updated>Mon, 14 Oct 2019 12:35:07 +0000</updated>
                            <resolved>Sat, 28 Sep 2019 04:01:04 +0000</resolved>
                                    <version>Upstream</version>
                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.12.3</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="254613" author="pfarrell" created="Thu, 12 Sep 2019 14:28:05 +0000"  >&lt;p&gt;Tamas,&lt;/p&gt;

&lt;p&gt;Are you able to provide dmesg from your node?&#160; (You can attach a file here)&lt;/p&gt;

&lt;p&gt;Also, what version of e2fsprogs are you using?&#160; (output of rpm -qa | grep e2fsprogs would work for this)&lt;/p&gt;

&lt;p&gt;If possible, it would also be nice to get this:&lt;/p&gt;

&lt;p&gt;After gathering dmesg, if you can also (while the mkfs is hung) do:&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;echo&#160;t&#160;&amp;gt; /proc/sysrq-trigger &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Then gather dmesg again and attach that as well. (Gathering dmesg twice is necessary because this can produce so much output that it will overwrite your existing dmesg.)&lt;/p&gt;</comment>
                            <comment id="254615" author="pjones" created="Thu, 12 Sep 2019 14:40:17 +0000"  >&lt;p&gt;Furthermore, I would suggest that you focus on the tip of b2_12 rather than using master in your tests. The intention is to add support for RHEL 7.7 with the upcoming 2.12.3 release and the current b2_12 is close to the release version.&lt;/p&gt;</comment>
                            <comment id="254616" author="kazinczy" created="Thu, 12 Sep 2019 15:11:08 +0000"  >&lt;p&gt;We have:&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;e2fsprogs.x86_64                 1.45.2.wc1-0.el7                  @e2fsprogs-wc&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;I&apos;ve just attached dmesg outputs.&lt;/p&gt;</comment>
                            <comment id="254617" author="degremoa" created="Thu, 12 Sep 2019 15:28:03 +0000"  >&lt;p&gt;Just to confirm I also hit the same issue using the usual Lustre development environment.&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;$ git reflog
219c519 HEAD@{0}: clone: from https://review.whamcloud.com/fs/lustre-release
$ rpm -q e2fsprogs
e2fsprogs-1.45.2.wc1-0.el7.x86_64
$ uname -r
3.10.0-1062.el7.x86_64&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;



&lt;p&gt;&#160;I&apos;m just using RHEL 7.7&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;
git cloned lustre master branch
sh ./autogen.sh
./configure
make
REFORMAT=: ./lustre/tests/llmount.sh
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="254633" author="yujian" created="Thu, 12 Sep 2019 19:15:03 +0000"  >&lt;p&gt;Hi Tamas and Aurelien,&lt;/p&gt;

&lt;p&gt;I didn&apos;t hit the above issue after building Lustre 2.12.57 from source codes on a VirtualBox RHEL 7.7 vm against kernel 3.10.0-1062.el7.&lt;/p&gt;

&lt;p&gt;Before compiling Lustre codes, did you patch the kernel? &lt;/p&gt;</comment>
                            <comment id="254635" author="yujian" created="Thu, 12 Sep 2019 20:07:03 +0000"  >&lt;p&gt;FYI, here are the steps I performed on a RHEL 7.7 vm:&lt;br/&gt;
Build kernel:&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;git clone git://git.whamcloud.com/fs/lustre-release.git
cd lustre-release/
sh ./autogen.sh

cd
mkdir -p kernel/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cd kernel
echo &apos;%_topdir %(echo $HOME)/kernel/rpmbuild&apos; &amp;gt; ~/.rpmmacros
rpm -ivh /root/kernelrpm/kernel-3.10.0-1062.el7.src.rpm
cd /root/kernel/rpmbuild/
rpmbuild -bp --target=`uname -m` ./SPECS/kernel.spec

cd /root/lustre-release/lustre/kernel_patches/series/
for patch in $(&amp;lt;&quot;3.10-rhel7.7.series&quot;); do patch_file=&quot;$HOME/lustre-release/lustre/kernel_patches/patches/${patch}&quot;; cat &quot;${patch_file}&quot; &amp;gt;&amp;gt; &quot;$HOME/lustre-kernel-x86_64-lustre.patch&quot;; done
cp ~/lustre-kernel-x86_64-lustre.patch ~/kernel/rpmbuild/SOURCES/patch-3.10.0-lustre.patch

sed -i.inst -e &apos;/find $RPM_BUILD_ROOT\/lib\/modules\/$KernelVer/a\
    cp -a fs/ext3/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext3 \
    cp -a fs/ext4/* $RPM_BUILD_ROOT/lib/modules/$KernelVer/build/fs/ext4&apos; \
-e &apos;/^# empty final patch to facilitate testing of kernel patches/i\
Patch99995: patch-%{version}-lustre.patch&apos; \
-e &apos;/^ApplyOptionalPatch linux-kernel-test.patch/i\
ApplyOptionalPatch patch-%{version}-lustre.patch&apos; \
-e &apos;/^%define listnewconfig_fail 1/s/1/0/&apos; \
~/kernel/rpmbuild/SPECS/kernel.spec

cd
echo &apos;# x86_64&apos; &amp;gt; ~/kernel/rpmbuild/SOURCES/kernel-3.10.0-x86_64.config
cat ~/lustre-release/lustre/kernel_patches/kernel_configs/kernel-3.10.0-3.10-rhel7.7-x86_64.config &amp;gt;&amp;gt; ~/kernel/rpmbuild/SOURCES/kernel-3.10.0-x86_64.config

cd ~/kernel/rpmbuild
buildid=&quot;_lustre&quot;
rpmbuild -ba --with firmware --target x86_64 --with baseonly --without kabichk --define &quot;buildid ${buildid}&quot; ~/kernel/rpmbuild/SPECS/kernel.spec

cd /root/kernel/rpmbuild/RPMS/x86_64/
rpm -ivh kernel-3.10.0-1062.el7_lustre.x86_64.rpm kernel-devel-3.10.0-1062.el7_lustre.x86_64.rpm kernel-headers-3.10.0-1062.el7_lustre.x86_64.rpm kernel-tools-3.10.0-1062.el7_lustre.x86_64.rpm kernel-tools-libs-3.10.0-1062.el7_lustre.x86_64.rpm --force
sync
shutdown -r 0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Build Lustre:&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;cd lustre-release/
./configure --with-linux=/root/kernel/rpmbuild/BUILD/kernel-3.10.0-1062.el7/linux-3.10.0-1062.el7_lustre.x86_64/
make
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the wiki page for compiling Lustre: &lt;a href=&quot;http://wiki.lustre.org/Compiling_Lustre&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://wiki.lustre.org/Compiling_Lustre&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="254652" author="degremoa" created="Fri, 13 Sep 2019 07:41:20 +0000"  >&lt;p&gt;Hi Jian,&lt;/p&gt;

&lt;p&gt;No, I did not patched the kernel but I though this is needed only when using project quota feature?&lt;/p&gt;

&lt;p&gt;I just realized I downgraded my kernel to 3.10.0-957.10.1.el7_lustre, which is the patched version from Whamcloud. So it seems really related to the kernel patches.&lt;/p&gt;</comment>
                            <comment id="254653" author="kazinczy" created="Fri, 13 Sep 2019 07:44:54 +0000"  >&lt;p&gt;Hey Jian,&lt;/p&gt;

&lt;p&gt;I forgot to tell that I&apos;d like to have patchless servers.&lt;/p&gt;</comment>
                            <comment id="254680" author="yujian" created="Fri, 13 Sep 2019 22:02:18 +0000"  >&lt;p&gt;Thank you Aurelien and Tamas for the info.&lt;br/&gt;
I can reproduce the issue with patchless server build. With vfs-project-quotas-rhel7.patch applied to kernel, the issue disappeared. I&apos;m looking into the related ldiskfs patches.&lt;/p&gt;</comment>
                            <comment id="254687" author="adilger" created="Fri, 13 Sep 2019 23:39:22 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=degremoa&quot; class=&quot;user-hover&quot; rel=&quot;degremoa&quot;&gt;degremoa&lt;/a&gt;, are you also seeing the hang with the same stack trace (stuck on a spinlock in the quota inode during unmount)?  While it is a bit confusing, &lt;tt&gt;mkfs.lustre&lt;/tt&gt; is mounting the filesystem internally to create Lustre configuration files. &lt;/p&gt;

&lt;p&gt;I&apos;d guess that there is something wrong with the quota inodes stored in the superblock, like they are not initialized, or the spinlock is not initialized, which only shows up because we are formatting then mounting and unmounting the filesystem so quickly.&lt;/p&gt;</comment>
                            <comment id="254696" author="yujian" created="Sat, 14 Sep 2019 07:36:59 +0000"  >&lt;p&gt;Hi Andreas,&lt;br/&gt;
While running mkfs.lustre, ldiskfs_write_ldd() mounted the device temporarily to write CONFIGS/mountdata. The hang occurred while unmounting the device.&lt;br/&gt;
I compared ldiskfs patch ext4-projid-ignore-maxquotas.patch and kernels for RHEL 7.7 and 7.6, and found the following &lt;tt&gt;ext4_quota_off_umount()&lt;/tt&gt; was added into &lt;tt&gt;ext4_put_super()&lt;/tt&gt; for RHEL 7.7 kernel 3.10.0-1062.el7:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeHeader panelHeader&quot; style=&quot;border-bottom-width: 1px;&quot;&gt;&lt;b&gt;ext4_quota_off_umount() and ext4_put_super()&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
#ifdef CONFIG_QUOTA
&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_quota_off(struct super_block *sb, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type);

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline void ext4_quota_off_umount(struct super_block *sb)
{
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type;

        &lt;span class=&quot;code-comment&quot;&gt;/* Use our quota_off function to clear inode flags etc. */&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (type = 0; type &amp;lt; MAXQUOTAS; type++)
                ext4_quota_off(sb, type);
}
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline void ext4_quota_off_umount(struct super_block *sb)
{
}
#endif

&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; void ext4_put_super(struct super_block *sb)
{
        struct ext4_sb_info *sbi = EXT4_SB(sb);
        struct ext4_super_block *es = sbi-&amp;gt;s_es;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; aborted = 0;
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; i, err;

        ext4_unregister_li_request(sb);
        ext4_quota_off_umount(sb);
        &amp;lt;~snip~&amp;gt;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;inode_lock(inode) and inode_unlock(inode) were also added into ext4_quota_off() for RHEL 7.7 kernel.&lt;/p&gt;</comment>
                            <comment id="254707" author="adilger" created="Sat, 14 Sep 2019 16:51:08 +0000"  >&lt;p&gt;Can you please check the upstream kernel to see if there is some additional fix to this code?  If yes, then it should be backported tinour ldiskfs series, and also reported to RH. &lt;/p&gt;</comment>
                            <comment id="254708" author="yujian" created="Sat, 14 Sep 2019 17:38:31 +0000"  >&lt;p&gt;Sure, Andreas. Let me do this.&lt;/p&gt;</comment>
                            <comment id="254710" author="yujian" created="Sun, 15 Sep 2019 07:57:45 +0000"  >&lt;p&gt;Hi Andreas,&lt;br/&gt;
The ext4_quota_off_umount() function and ext4_quota_on/off() changes were added by the following Linux kernel commit:&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;commit 957153fce8d226612de05938ca18101b7d608328
Author: Jan Kara &amp;lt;jack@suse.cz&amp;gt;
Date:   Thu Apr 6 15:40:06 2017 +0200

    ext4: Set flags on quota files directly
    
    Currently immutable and noatime flags on quota files are set by quota
    code which requires us to copy inode-&amp;gt;i_flags to our on disk version of
    quota flags in GETFLAGS ioctl and ext4_do_update_inode(). Move to
    setting / clearing these on-disk flags directly to save that copying.
    
    Signed-off-by: Jan Kara &amp;lt;jack@suse.cz&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;However after that, there is no additional fix related to the issue in this ticket.&lt;/p&gt;

&lt;p&gt;I&apos;m wondering why after applying vfs-project-quotas-rhel7.patch, the issue disappeared.&lt;/p&gt;</comment>
                            <comment id="254765" author="degremoa" created="Mon, 16 Sep 2019 22:35:14 +0000"  >&lt;p&gt;Andreas, for some unknown reason my system keeps crashing when I try to reproduce this issue. Kernel crashes instead of hitting this during MDT formatting.&lt;/p&gt;

&lt;p&gt;But I think you got everything you need for this problem anyway, no?&lt;/p&gt;</comment>
                            <comment id="254817" author="adilger" created="Mon, 16 Sep 2019 23:06:29 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=yujian&quot; class=&quot;user-hover&quot; rel=&quot;yujian&quot;&gt;yujian&lt;/a&gt;, it looks like this may indeed be related to the project quota patch. &lt;/p&gt;

&lt;p&gt;With &lt;tt&gt;vfs-project-quotas-rhel7.patch&lt;/tt&gt; applied the kernel properly handles the project quota type (index 2, i.e. the 3rd quota type), and without it, the RHEL7 kernel doesn&apos;t handle this quota type.  In ldiskfs, we need to make sure that the loop in &lt;tt&gt;ext4_quota_off_umount()&lt;/tt&gt; is limiting the &lt;tt&gt;LDISKFS_MAXQUOTAS&lt;/tt&gt; loop to the kernel &lt;tt&gt;MAXQUOTAS&lt;/tt&gt;.  Otherwise, it is trying to dereference &lt;tt&gt;sb-&amp;gt;s_inode&lt;span class=&quot;error&quot;&gt;&amp;#91;2&amp;#93;&lt;/span&gt;&lt;/tt&gt; which is not an inode at all, just random memory.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=degremoa&quot; class=&quot;user-hover&quot; rel=&quot;degremoa&quot;&gt;degremoa&lt;/a&gt;, I think we are good.  It shouldn&apos;t be too hard to make a patch now that we (likely) know what the problem is.&lt;/p&gt;</comment>
                            <comment id="254818" author="adilger" created="Mon, 16 Sep 2019 23:13:44 +0000"  >&lt;p&gt;It looks like in &lt;tt&gt;ldiskfs/kernel_patches/patches/rhel7/ext4-projid-feature-support.patch&lt;/tt&gt; it should check how many quotas that the kernel supports:&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-comment&quot;&gt;/* &lt;span class=&quot;code-object&quot;&gt;Number&lt;/span&gt; of quota types we support */&lt;/span&gt;
+#&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; MAXQUOTAS &amp;gt; 2
+#define EXT4_MAXQUOTAS 3
+#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
 #define EXT4_MAXQUOTAS 2
+#endif
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or something similar, so that it doesn&apos;t try to use project quotas on an unpatched RHEL7 kernel.&lt;/p&gt;</comment>
                            <comment id="254820" author="yujian" created="Mon, 16 Sep 2019 23:19:31 +0000"  >&lt;p&gt;Thank you very much, Andreas. Let me push a patch and verify it.&lt;/p&gt;</comment>
                            <comment id="254827" author="adilger" created="Mon, 16 Sep 2019 23:28:35 +0000"  >&lt;p&gt;Looking into this a bit more (c.f. &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-20&quot; title=&quot;patchless server kernel&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-20&quot;&gt;&lt;del&gt;LU-20&lt;/del&gt;&lt;/a&gt;), it seems that we may want the same code to module with both a patched and unpatched kernel, so it is probably better to keep &lt;tt&gt;EXT4_MAXQUOTAS=3&lt;/tt&gt; and decide whether to disable the project quota at unmount during runtime rather than at compile time.  Something similar to how quota is enabled for the various types:&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;
@@ -819,7 +819,7 @@ &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline void ext4_quota_off_umount
        &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; type;
 
        &lt;span class=&quot;code-comment&quot;&gt;/* Use our quota_off function to clear inode flags etc. */&lt;/span&gt;
-       &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (type = 0; type &amp;lt; MAXQUOTAS; type++)
-                ext4_quota_off(sb, type);
+       &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (type = 0; type &amp;lt; EXT4_MAXQUOTAS; type++)
+               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (EXT4_SB(sb)-&amp;gt;s_qf_names[i])
+                       ext4_quota_off(sb, type);
 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The existing check &quot;&lt;tt&gt;if (!inode0&lt;/tt&gt;&quot; inside &lt;tt&gt;ext4&amp;#95;quota&amp;#95;off()&lt;/tt&gt; is incorrect in this case because &lt;tt&gt;sb_dqopt(sb)&amp;#45;&amp;gt;files&lt;span class=&quot;error&quot;&gt;&amp;#91;type&amp;#93;&lt;/span&gt;&lt;/tt&gt; is located in the kernel superblock, which was not compiled to have enough space for the project quota.  It may be that &lt;tt&gt;ext4_orphan_cleanup()&lt;/tt&gt; needs a similar change to check &lt;tt&gt;EXT4&amp;#95;SB(sb)&amp;#45;&amp;gt;s&amp;#95;qf&amp;#95;names&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt;&lt;/tt&gt; instead, since that is located inside the ext4/ldiskfs module and will be self-consistent.&lt;/p&gt;</comment>
                            <comment id="254843" author="gerrit" created="Tue, 17 Sep 2019 02:18:14 +0000"  >&lt;p&gt;Jian Yu (yujian@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36203&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36203&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12755&quot; title=&quot;CPU soft lockup on mkfs.lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12755&quot;&gt;&lt;del&gt;LU-12755&lt;/del&gt;&lt;/a&gt; ldiskfs: check s_qf_names in ext4_quota_off_umount()&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: fff55938f6266cdd9d201dae950079371a6fde3b&lt;/p&gt;</comment>
                            <comment id="254920" author="pjones" created="Tue, 17 Sep 2019 19:02:16 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=kazinczy&quot; class=&quot;user-hover&quot; rel=&quot;kazinczy&quot;&gt;kazinczy&lt;/a&gt; and/or &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=degremoa&quot; class=&quot;user-hover&quot; rel=&quot;degremoa&quot;&gt;degremoa&lt;/a&gt; can you verify whether this fix works for you?&lt;/p&gt;</comment>
                            <comment id="254928" author="yujian" created="Tue, 17 Sep 2019 20:04:13 +0000"  >&lt;p&gt;I just got the test result that the patch fixed the spinlock issue but hit another issue:&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;Kernel error detected: [   64.991808] VFS: Busy inodes after unmount of dm-0. Self-destruct in 5 seconds.  Have a nice day...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="254982" author="wshilong" created="Wed, 18 Sep 2019 14:57:41 +0000"  >&lt;p&gt;Apologies, I missed this important ticket.&lt;/p&gt;

&lt;p&gt;Jian Yu,&lt;/p&gt;

&lt;p&gt;Would you collect dumpe2fs -h /dev/dm-0 output?&lt;/p&gt;

&lt;p&gt;I guess we might load project inode but the logic is we did not iput it caused the problem, would you try following parts to see if it could fix above buys inode  problem:&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@server ext4]# git diff super.c
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ca8b50c8..e3fccb79 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5624,7 +5624,7 @@ static int ext4_enable_quotas(struct super_block *sb)
 
        sb_dqopt(sb)-&amp;gt;flags |= DQUOT_QUOTA_SYS_FILE;
        for (type = 0; type &amp;lt; EXT4_MAXQUOTAS; type++) {
-               if (qf_inums[type]) {
+               if (qf_inums[type] &amp;amp;&amp;amp; type &amp;lt; MAXQUOTAS) {
                        err = ext4_quota_enable(sb, type, QFMT_VFS_V1,
                                                DQUOT_USAGE_ENABLED);
                        if (err) {

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Andreas, any reasons that why we did not use first suggested way:&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; /* Number of quota types we support */
+#if MAXQUOTAS &amp;gt; 2
+#define EXT4_MAXQUOTAS 3
+#else
 #define EXT4_MAXQUOTAS 2
+#endif
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This looks much safe fix.&lt;/p&gt;</comment>
                            <comment id="254996" author="yujian" created="Wed, 18 Sep 2019 16:22:32 +0000"  >&lt;p&gt;Thank you, Shilong. Let me try the above changes.&lt;/p&gt;</comment>
                            <comment id="255005" author="adilger" created="Wed, 18 Sep 2019 18:34:24 +0000"  >&lt;p&gt;Shilong, the reason we don&apos;t use the static MAXQUOTAS limit at compile time is to allow using the same ldiskfs and osd-ldiskfs module on both patched and unpatched kernels. &lt;/p&gt;</comment>
                            <comment id="255006" author="yujian" created="Wed, 18 Sep 2019 19:08:27 +0000"  >&lt;p&gt;With the &quot;qf_inums&lt;span class=&quot;error&quot;&gt;&amp;#91;type&amp;#93;&lt;/span&gt; &amp;amp;&amp;amp; type &amp;lt; MAXQUOTAS&quot; change applied, the following failure still occurred:&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;Kernel error detected: [   67.386709] VFS: Busy inodes after unmount of dm-0. Self-destruct in 5 seconds.  Have a nice day...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="255045" author="wshilong" created="Thu, 19 Sep 2019 14:51:22 +0000"  >&lt;p&gt;Let me setup an environment and try locally.&lt;/p&gt;</comment>
                            <comment id="255059" author="adilger" created="Thu, 19 Sep 2019 18:03:10 +0000"  >&lt;p&gt;Jian, can you please push a separate patch with the &quot;simple&quot; version of the patch, which limits &lt;tt&gt;EXT4_MAX_QUOTAS&lt;/tt&gt; to the kernel &lt;tt&gt;MAXQUOTAS&lt;/tt&gt; value, if smaller. That will at least tell us if this is the source of the problem. &lt;/p&gt;</comment>
                            <comment id="255060" author="yujian" created="Thu, 19 Sep 2019 18:06:53 +0000"  >&lt;p&gt;Sure, Andreas.&lt;/p&gt;</comment>
                            <comment id="255064" author="gerrit" created="Thu, 19 Sep 2019 19:13:24 +0000"  >&lt;p&gt;Jian Yu (yujian@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36241&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36241&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12755&quot; title=&quot;CPU soft lockup on mkfs.lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12755&quot;&gt;&lt;del&gt;LU-12755&lt;/del&gt;&lt;/a&gt; ldiskfs: limit EXT4_MAXQUOTAS to MAXQUOTAS&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: b0965235b20ff03c55eaeae6d917d6e3f11968f7&lt;/p&gt;</comment>
                            <comment id="255076" author="wshilong" created="Fri, 20 Sep 2019 02:13:26 +0000"  >&lt;p&gt;OK, the problem is that we leaked USR and Group inode, comments on first patch, I agreed we&apos;d better use first patch.&lt;/p&gt;</comment>
                            <comment id="255077" author="wshilong" created="Fri, 20 Sep 2019 02:24:56 +0000"  >&lt;p&gt;Also it will be interesting that with project quota enabled but unpatched kernel used, I just tested it will fail:&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;  642.115121]  [&amp;lt;ffffffff93379262&amp;gt;] dump_stack+0x19/0x1b
[  642.115888]  [&amp;lt;ffffffffc091606a&amp;gt;] ldiskfs_quota_enable+0x10a/0x120 [ldiskfs]
[  642.116934]  [&amp;lt;ffffffffc091807b&amp;gt;] ldiskfs_enable_quotas+0x9b/0x110 [ldiskfs]
[  642.117962]  [&amp;lt;ffffffffc091c490&amp;gt;] ldiskfs_fill_super+0x2e60/0x2e80 [ldiskfs]
[  642.118993]  [&amp;lt;ffffffff92e4c893&amp;gt;] mount_bdev+0x1b3/0x1f0
[  642.119790]  [&amp;lt;ffffffffc0919630&amp;gt;] ? ldiskfs_calculate_overhead+0x430/0x430 [ldiskfs]
[  642.120951]  [&amp;lt;ffffffffc0913605&amp;gt;] ldiskfs_mount+0x15/0x20 [ldiskfs]
[  642.121874]  [&amp;lt;ffffffff92e4d1fe&amp;gt;] mount_fs+0x3e/0x1b0
[  642.122624]  [&amp;lt;ffffffff92de1035&amp;gt;] ? __alloc_percpu+0x15/0x20
[  642.123409]  [&amp;lt;ffffffff92e6b377&amp;gt;] vfs_kern_mount+0x67/0x110
[  642.124225]  [&amp;lt;ffffffff92e6dacf&amp;gt;] do_mount+0x1ef/0xce0
[  642.124983]  [&amp;lt;ffffffff92e4521a&amp;gt;] ? __check_object_size+0x1ca/0x250
[  642.125919]  [&amp;lt;ffffffff92ddbe7f&amp;gt;] ? memdup_user+0x4f/0x80
[  642.126723]  [&amp;lt;ffffffff92e6e903&amp;gt;] SyS_mount+0x83/0xd0
[  642.127521]  [&amp;lt;ffffffff9338bede&amp;gt;] system_call_fastpath+0x25/0x2a
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I think we also need this extra fix for that:&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@server ext4]# git diff super.c
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ca8b50c8..e3fccb79 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5624,7 +5624,7 @@ static int ext4_enable_quotas(struct super_block *sb)
 
        sb_dqopt(sb)-&amp;gt;flags |= DQUOT_QUOTA_SYS_FILE;
        for (type = 0; type &amp;lt; EXT4_MAXQUOTAS; type++) {
-               if (qf_inums[type]) {
+               if (qf_inums[type] &amp;amp;&amp;amp; type &amp;lt; MAXQUOTAS) {
                        err = ext4_quota_enable(sb, type, QFMT_VFS_V1,
                                                DQUOT_USAGE_ENABLED);
                        if (err) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="255115" author="adilger" created="Fri, 20 Sep 2019 09:28:24 +0000"  >&lt;blockquote&gt;
&lt;p&gt;I think we also need this extra fix for that:&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;
[root@server ext4]# git diff &lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;.c

@@ -5624,7 +5624,7 @@ &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_enable_quotas(struct super_block *sb)
 
        sb_dqopt(sb)-&amp;gt;flags |= DQUOT_QUOTA_SYS_FILE;
        &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; (type = 0; type &amp;lt; EXT4_MAXQUOTAS; type++) {
-               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (qf_inums[type]) {
+               &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (qf_inums[type] &amp;amp;&amp;amp; type &amp;lt; MAXQUOTAS) {
                        err = ext4_quota_enable(sb, type, QFMT_VFS_V1,
                                                DQUOT_USAGE_ENABLED);
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (err) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;It isn&apos;t clear if this will fix all of the problems, since it is taking the MAXQUOTAS value from the kernel at build time, not at runtime.  Since we always build against a patched kernel with MAXQUOTAS=3, it wouldn&apos;t restrict the code.  It probably would help for the case of building against a patched kernel.&lt;/p&gt;</comment>
                            <comment id="255116" author="wshilong" created="Fri, 20 Sep 2019 09:30:03 +0000"  >&lt;p&gt;Yup, I was thinking that to make us ldiskfs.ko module works for both patched and unpatched kernel:&lt;/p&gt;

&lt;p&gt;using following way to check:&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;bool is_proj_supported_by_kernel(struct super_block *sb)
{
    return (sizeof(sb_dqopt(sb)-&amp;gt;info) / sizeof(struct mem_dqinfo)) &amp;gt; PRJQUOTA;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="255117" author="adilger" created="Fri, 20 Sep 2019 09:49:37 +0000"  >&lt;p&gt;This will still return the size of the structures matching the kernel that ldiskfs was built against, not necessarily the kernel that the module is loaded with. &lt;/p&gt;

&lt;p&gt;We would need that function to be exported by the running kernel, which would mean to patch the kernel (obviously not possible for the unpatched kernel, and very unlikely to get upstream).&lt;/p&gt;

&lt;p&gt;Instead, we need to find something that is exported from the &lt;b&gt;running&lt;/b&gt; kernel that gives us information about whether it supports project quotas.&lt;/p&gt;</comment>
                            <comment id="255118" author="wshilong" created="Fri, 20 Sep 2019 10:07:11 +0000"  >&lt;p&gt;Hmm, you are right..&lt;/p&gt;

&lt;p&gt;But haven&apos;t found a way to do that since Kernel mostly use static value MAXQUOTAS..&lt;/p&gt;</comment>
                            <comment id="255119" author="lixi_wc" created="Fri, 20 Sep 2019 10:23:02 +0000"  >&lt;p&gt;I am wondering whether the following way would help use to get the MAXQUOTAS of the running kernel (using a tricky way):&lt;/p&gt;

&lt;p&gt;1) We call dquot_initialize(inode) in OSD/ldiskfs.&lt;br/&gt;
2) __dquot_initialize() calls inode-&amp;gt;i_sb-&amp;gt;dq_op-&amp;gt;get_projid()&lt;br/&gt;
3) We patch ldiskfs to change ext4_get_projid(). In ext4_get_projid(), it set a static flag to show that the kernel actually supports PRJQUOTA.&lt;/p&gt;

&lt;p&gt;However, dquot_initialize() depends on ext4_enable_quotas? So might not be workable...&lt;/p&gt;</comment>
                            <comment id="255122" author="wshilong" created="Fri, 20 Sep 2019 11:04:08 +0000"  >&lt;p&gt;In the mount phase, ROOT inode will call dquot_initialize() first time but  at that time ext4_enable_quotas() haven&apos;t been called, and unfortunately we also need check whether kernel support PRJQUOTA inside ext4_enable_quotas().....&lt;/p&gt;

&lt;p&gt;So this way won&apos;t work..&lt;/p&gt;</comment>
                            <comment id="255123" author="wshilong" created="Fri, 20 Sep 2019 11:48:24 +0000"  >&lt;p&gt;unfortunately it looks hard to make it work ideally, we coud not be blocked at this, at least we need fix common case, how about&lt;br/&gt;
we add some warning messages during mount time?&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;diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ca8b50c8..cddf6595 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4489,6 +4489,13 @@ no_journal:
        ratelimit_state_init(&amp;amp;sbi-&amp;gt;s_msg_ratelimit_state, 5 * HZ, 10);
 
        kfree(orig_data);
+#ifdef  HAVE_PROJECT_QUOTA
+       ext4_msg(sb, KERN_WARNING, 
+               &quot;ext4 module compiled with patched kernel won&apos;t work on unpatched kernel&quot;);
+#else
+       ext4_msg(sb, KERN_WARNING, 
+               &quot;ext4 module compiled with unpatched kernel won&apos;t work on patched kernel&quot;);
+#endif
        return 0;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Mark it as a known issue, at least Administrator knows this issue.&lt;/p&gt;</comment>
                            <comment id="255124" author="wshilong" created="Fri, 20 Sep 2019 11:50:53 +0000"  >&lt;p&gt;The good new is this issue won&apos;t exist for RHEL8 and later kernels though..&lt;/p&gt;</comment>
                            <comment id="255127" author="lixi_wc" created="Fri, 20 Sep 2019 12:23:49 +0000"  >&lt;p&gt;Instead of printing an error, returning error seems better. It will prevent any future problem.&lt;/p&gt;</comment>
                            <comment id="255128" author="lixi_wc" created="Fri, 20 Sep 2019 12:28:30 +0000"  >&lt;blockquote&gt;&lt;p&gt;In the mount phase, ROOT inode will call dquot_initialize() first time but at that time ext4_enable_quotas() haven&apos;t been called, and unfortunately we also need check whether kernel support PRJQUOTA inside ext4_enable_quotas().....&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;I think we can ext4_enable_quotas() first on group quota and user quota. And then set the flag of sb_has_quota_active(PROJQUOTA) temporarily. And then call dquot_initialize() to check whether MAXQUOTAS == 3.&lt;/p&gt;</comment>
                            <comment id="255154" author="wshilong" created="Fri, 20 Sep 2019 15:24:54 +0000"  >&lt;p&gt;The tricky way seems work with limited testing, Yu Jian could you continue some testing on refreshed patch:&lt;/p&gt;

&lt;p&gt;1) Built and installed. ldiskfs on patched kernel and then switch it to unpatched kernel.&lt;br/&gt;
2) Built and installed ldiskfs on unpatched kernel and then switch it to patched kernel.&lt;/p&gt;

&lt;p&gt;To make sure mount and umount Lustre works.&lt;/p&gt;</comment>
                            <comment id="255159" author="yujian" created="Fri, 20 Sep 2019 16:09:54 +0000"  >&lt;p&gt;Sure, Shilong.&lt;/p&gt;</comment>
                            <comment id="255160" author="lixi_wc" created="Fri, 20 Sep 2019 16:10:41 +0000"  >&lt;p&gt;Shilong, I assume you mean the updated patch &lt;a href=&quot;https://review.whamcloud.com/#/c/36203/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/36203/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any reason why ext4_get_projid() is called before ext4_enable_quotas()? I thought ext4_enable_quotas() is always called before any one calls ext4_get_projid().&lt;/p&gt;</comment>
                            <comment id="255179" author="wshilong" created="Sat, 21 Sep 2019 02:55:03 +0000"  >&lt;p&gt;Li Xi,&lt;/p&gt;

&lt;p&gt;I walkrounded that issue by set PROJ active flag temporariy, and then call dquot_initialize() to call ext4_get_projid().&lt;br/&gt;
I just tested fixed version, it seems work:&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;+	sb_dqopt(sb)-&amp;gt;flags |= dquot_state_flag(DQUOT_USAGE_ENABLED, PRJQUOTA);
+	dquot_initialize(root);
+	sb_dqopt(sb)-&amp;gt;flags &amp;amp;= ~dquot_state_flag(DQUOT_USAGE_ENABLED, PRJQUOTA);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;By adding some printk debug, it seems detection works.&lt;/p&gt;</comment>
                            <comment id="255219" author="gerrit" created="Mon, 23 Sep 2019 07:22:14 +0000"  >&lt;p&gt;Jian Yu (yujian@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/36270&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36270&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12755&quot; title=&quot;CPU soft lockup on mkfs.lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12755&quot;&gt;&lt;del&gt;LU-12755&lt;/del&gt;&lt;/a&gt; ldiskfs: fix project quota unpon unpatched kernel&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e56b4bc0970275ce6413883794bd52d2dfa7b164&lt;/p&gt;</comment>
                            <comment id="255517" author="gerrit" created="Fri, 27 Sep 2019 23:12:44 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36203/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36203/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12755&quot; title=&quot;CPU soft lockup on mkfs.lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12755&quot;&gt;&lt;del&gt;LU-12755&lt;/del&gt;&lt;/a&gt; ldiskfs: fix project quota unpon unpatched kernel&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: d780f15a2d63c8bde5ae6345aed85b4b44904fb5&lt;/p&gt;</comment>
                            <comment id="255533" author="pjones" created="Sat, 28 Sep 2019 04:01:04 +0000"  >&lt;p&gt;Landed for 2.13&lt;/p&gt;</comment>
                            <comment id="255936" author="gerrit" created="Fri, 4 Oct 2019 20:30:26 +0000"  >&lt;p&gt;Oleg Drokin (green@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/36270/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36270/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-12755&quot; title=&quot;CPU soft lockup on mkfs.lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-12755&quot;&gt;&lt;del&gt;LU-12755&lt;/del&gt;&lt;/a&gt; ldiskfs: fix project quota unpon unpatched kernel&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_12&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 820e374624a584ec0c0a326ec96bf0abeb50cf40&lt;/p&gt;</comment>
                            <comment id="256321" author="kazinczy" created="Mon, 14 Oct 2019 07:25:27 +0000"  >&lt;p&gt;I can confirm that &lt;tt&gt;mkfs.lustre&lt;/tt&gt; for patchless LDISKFS from b2_12 works fine for me now.&lt;/p&gt;</comment>
                            <comment id="256329" author="pjones" created="Mon, 14 Oct 2019 12:35:07 +0000"  >&lt;p&gt;Great. Thanks for confirming &lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=kazinczy&quot; class=&quot;user-hover&quot; rel=&quot;kazinczy&quot;&gt;kazinczy&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="33491" name="mgs1-dmesg-2019-09-12-16h43m" size="107434" author="kazinczy" created="Thu, 12 Sep 2019 15:09:31 +0000"/>
                            <attachment id="33492" name="mgs1-dmesg-2019-09-12-16h58m" size="908541" author="kazinczy" created="Thu, 12 Sep 2019 15:09:31 +0000"/>
                    </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_10040" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Epic</customfieldname>
                        <customfieldvalues>
                                        <label>hang</label>
            <label>server</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10030" key="com.atlassian.jira.plugin.system.customfieldtypes:labels">
                        <customfieldname>Epic/Theme</customfieldname>
                        <customfieldvalues>
                                        <label>Lustre-2.12.57</label>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i00mov:</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>