<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:40:12 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-11015] Do not free lov kobject twice</title>
                <link>https://jira.whamcloud.com/browse/LU-11015</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Looks like commit 3c900918 / &lt;a href=&quot;https://review.whamcloud.com/30960&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/30960&lt;/a&gt; introduced a bit of a problem where we can put lov_tgts_kobj twice while we are actually holding only one reference.&lt;/p&gt;

&lt;p&gt;The problem is in lov_putref:&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;        mutex_lock(&amp;amp;lov-&amp;gt;lov_lock);
        &lt;span class=&quot;code-comment&quot;&gt;/* ok to dec to 0 more than once -- ltd_exp&apos;s will be &lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; */&lt;/span&gt;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (atomic_dec_and_test(&amp;amp;lov-&amp;gt;lov_refcount) &amp;amp;&amp;amp; lov-&amp;gt;lov_death_row) {
                struct list_head kill = LIST_HEAD_INIT(kill);
...
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lov-&amp;gt;lov_tgts_kobj)
                        kobject_put(lov-&amp;gt;lov_tgts_kobj);

        } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;So when the listed condition of dec to 0 happens more than once we do the put twice (since we dont&apos; zero out the lov_tgts_kobj pointer.&lt;/p&gt;

&lt;p&gt;Seems like we just need to set it to NULL there for things to work correctly.&lt;/p&gt;

&lt;p&gt;The crash looks something like this:&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;[50173.869510] Lustre: DEBUG MARKER: == conf-sanity test 50g: deactivated OST should not cause panic ====================================== 11:18:14 (1525879094)
[50199.609971] Lustre: DEBUG MARKER: centos-24.localnet: executing wait_import_state FULL osc.lustre-OST0001-osc-MDT0000.ost_server_uuid 40
[50206.043193] Lustre: DEBUG MARKER: osc.lustre-OST0001-osc-MDT0000.ost_server_uuid in FULL state after 6 sec
[50206.755766] Lustre: DEBUG MARKER: centos-24.localnet: executing wait_import_state FULL osc.lustre-OST0001-osc-ffff8802ca6c0800.ost_server_uuid 40
[50206.930583] Lustre: DEBUG MARKER: osc.lustre-OST0001-osc-ffff8802ca6c0800.ost_server_uuid in FULL state after 0 sec
[50207.193737] Lustre: lfs: using old ioctl(LL_IOC_LOV_GETSTRIPE) on [0x200000bd0:0x1:0x0], use llapi_layout_get_by_path()
[50207.245506] Lustre: Permanently deactivating lustre-OST0001
[50209.744659] LustreError: 21378:0:(sec.c:407:import_sec_validate_get()) import ffff8802a452c000 (NEW) with no sec
[50210.979738] LustreError: 21396:0:(lov_obd.c:826:lov_cleanup()) lustre-clilov-ffff8802a694c800: lov tgt 1 not cleaned! deathrow=0, lovrc=1
[50211.000820] ------------[ cut here ]------------
[50211.001549] WARNING: at lib/kobject.c:600 kobject_put+0x50/0x60()
[50211.002347] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
[50211.003054] Modules linked in: lustre(OE) ofd(OE) osp(OE) lod(OE) ost(OE) mdt(OE) mdd(OE) mgs(OE) osd_zfs(OE) lquota(OE) lfsck(OE) obdecho(OE) mgc(OE) lov(OE) mdc(OE) osc(OE) lmv(OE) fid(OE) fld(OE) ptlrpc_gss(OE) ptlrpc(OE) obdclass(OE) ksocklnd(OE) lnet(OE) libcfs(OE) zfs(PO) zunicode(PO) zavl(PO) icp(PO) zcommon(PO) znvpair(PO) spl(O) zlib_deflate jbd2 syscopyarea sysfillrect sysimgblt ttm ata_generic drm_kms_helper pata_acpi drm ata_piix i2c_piix4 virtio_console pcspkr serio_raw virtio_balloon virtio_blk libata i2c_core floppy nfsd ip_tables rpcsec_gss_krb5 [last unloaded: libcfs]
[50211.009320] CPU: 3 PID: 21396 Comm: umount Tainted: P        W  OE  ------------   3.10.0-debug #2
[50211.010550] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[50211.011246] task: ffff8802994c0a00 ti: ffff8802d93cc000 task.ti: ffff8802d93cc000
[50211.012482] RIP: 0010:[&amp;lt;ffffffff8137faed&amp;gt;]  [&amp;lt;ffffffff8137faed&amp;gt;] strnlen+0xd/0x40
[50211.013738] RSP: 0018:ffff8802d93cf830  EFLAGS: 00010086
[50211.014402] RAX: ffffffff81a6dea9 RBX: ffffffff820d58ec RCX: fffffffffffffffe
[50211.015091] RDX: 3a65727473756c2b RSI: ffffffffffffffff RDI: 3a65727473756c2b
[50211.015798] RBP: ffff8802d93cf830 R08: 000000000000ffff R09: 000000000000ffff
[50211.016593] R10: 00000000000000a0 R11: 0000000000000050 R12: 3a65727473756c2b
[50211.017446] R13: ffffffff820d5cc0 R14: 00000000ffffffff R15: 0000000000000000
[50211.018203] FS:  00007f593f158880(0000) GS:ffff88033e460000(0000) knlGS:0000000000000000
[50211.019452] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[50211.020105] CR2: 000000000218f000 CR3: 000000029ed76000 CR4: 00000000000006e0
[50211.020817] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[50211.023442] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[50211.024073] Stack:
[50211.024501]  ffff8802d93cf868 ffffffff81381fbb ffffffff820d58ec ffffffff820d5cc0
[50211.025405]  ffff8802d93cf9c0 ffffffff81aa0bbe ffffffff81aa0bbe ffff8802d93cf8d8
[50211.026296]  ffffffff81383751 0000000000000246 ffffffffffffff10 000000000000000c
[50211.027199] Call Trace:
[50211.027628]  [&amp;lt;ffffffff81381fbb&amp;gt;] string.isra.7+0x3b/0xf0
[50211.028088]  [&amp;lt;ffffffff81383751&amp;gt;] vsnprintf+0x201/0x6a0
[50211.028551]  [&amp;lt;ffffffff81383bfd&amp;gt;] vscnprintf+0xd/0x30
[50211.029017]  [&amp;lt;ffffffff81078766&amp;gt;] vprintk_emit+0x116/0x5a0
[50211.029496]  [&amp;lt;ffffffff81378f20&amp;gt;] ? kobject_put+0x50/0x60
[50211.029954]  [&amp;lt;ffffffff81378f20&amp;gt;] ? kobject_put+0x50/0x60
[50211.030426]  [&amp;lt;ffffffff81078c0f&amp;gt;] vprintk+0x1f/0x30
[50211.030877]  [&amp;lt;ffffffff8107623c&amp;gt;] warn_slowpath_common+0x5c/0xb0
[50211.031356]  [&amp;lt;ffffffff810762ec&amp;gt;] warn_slowpath_fmt+0x5c/0x80
[50211.031837]  [&amp;lt;ffffffff81378f20&amp;gt;] kobject_put+0x50/0x60
[50211.032367]  [&amp;lt;ffffffffa08b93fe&amp;gt;] lov_putref+0x92e/0xac0 [lov]
[50211.032855]  [&amp;lt;ffffffffa08c08ff&amp;gt;] lov_cleanup+0x27f/0x610 [lov]
[50211.033416]  [&amp;lt;ffffffffa036d04a&amp;gt;] class_free_dev+0x1ea/0x650 [obdclass]
[50211.033913]  [&amp;lt;ffffffffa036d690&amp;gt;] class_export_put+0x1e0/0x2b0 [obdclass]
[50211.034426]  [&amp;lt;ffffffffa036f1e5&amp;gt;] class_unlink_export+0x135/0x170 [obdclass]
[50211.034931]  [&amp;lt;ffffffffa0384600&amp;gt;] class_decref+0x80/0x160 [obdclass]
[50211.035566]  [&amp;lt;ffffffffa0384a51&amp;gt;] class_detach+0x1b1/0x2e0 [obdclass]
[50211.036429]  [&amp;lt;ffffffffa038b47d&amp;gt;] class_process_config+0x196d/0x27e0 [obdclass]
[50211.037950]  [&amp;lt;ffffffffa01e36a7&amp;gt;] ? libcfs_debug_msg+0x57/0x80 [libcfs]
[50211.038785]  [&amp;lt;ffffffffa038c4d0&amp;gt;] class_manual_cleanup+0x1e0/0x6d0 [obdclass]
[50211.039780]  [&amp;lt;ffffffffa14bdef8&amp;gt;] ll_put_super+0x128/0x890 [lustre]
[50211.040571]  [&amp;lt;ffffffff8112b4cd&amp;gt;] ? call_rcu_sched+0x1d/0x20
[50211.041270]  [&amp;lt;ffffffffa14e69ec&amp;gt;] ? ll_destroy_inode+0x1c/0x20 [lustre]
[50211.041971]  [&amp;lt;ffffffff8120a3a8&amp;gt;] ? destroy_inode+0x38/0x60
[50211.042650]  [&amp;lt;ffffffff8120a4d6&amp;gt;] ? evict+0x106/0x170
[50211.043348]  [&amp;lt;ffffffff8120a57e&amp;gt;] ? dispose_list+0x3e/0x50
[50211.044088]  [&amp;lt;ffffffff8120b224&amp;gt;] ? evict_inodes+0x114/0x140
[50211.044712]  [&amp;lt;ffffffff811efa46&amp;gt;] generic_shutdown_super+0x56/0xe0
[50211.045205]  [&amp;lt;ffffffff811efe22&amp;gt;] kill_anon_super+0x12/0x20
[50211.045691]  [&amp;lt;ffffffffa038ee25&amp;gt;] lustre_kill_super+0x45/0x50 [obdclass]
[50211.046397]  [&amp;lt;ffffffff811f0329&amp;gt;] deactivate_locked_super+0x49/0x60
[50211.047227]  [&amp;lt;ffffffff811f0926&amp;gt;] deactivate_super+0x46/0x60
[50211.048048]  [&amp;lt;ffffffff8120f115&amp;gt;] mntput_no_expire+0xc5/0x120
[50211.048834]  [&amp;lt;ffffffff8121029f&amp;gt;] SyS_umount+0x9f/0x3c0
[50211.049764]  [&amp;lt;ffffffff8170fc49&amp;gt;] system_call_fastpath+0x16/0x1b
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and we can clearly see the putref entering that path twice in the debug log.&lt;/p&gt;</description>
                <environment></environment>
        <key id="52215">LU-11015</key>
            <summary>Do not free lov kobject twice</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</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="green">Oleg Drokin</assignee>
                                    <reporter username="green">Oleg Drokin</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 May 2018 18:43:52 +0000</created>
                <updated>Tue, 29 May 2018 10:58:34 +0000</updated>
                            <resolved>Tue, 29 May 2018 10:58:34 +0000</resolved>
                                                    <fixVersion>Lustre 2.12.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="227712" author="gerrit" created="Fri, 11 May 2018 18:46:18 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32367&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32367&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11015&quot; title=&quot;Do not free lov kobject twice&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11015&quot;&gt;&lt;del&gt;LU-11015&lt;/del&gt;&lt;/a&gt; lov: Do not release lov_tgts_kobj twice&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: e026a47f7766010884e28c27fd1c938daacd0279&lt;/p&gt;</comment>
                            <comment id="228730" author="gerrit" created="Tue, 29 May 2018 04:55:06 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/32367/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32367/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11015&quot; title=&quot;Do not free lov kobject twice&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11015&quot;&gt;&lt;del&gt;LU-11015&lt;/del&gt;&lt;/a&gt; lov: Move lov_tgts_kobj init to lov_setup&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 313ac16698dba613c079303565c8db52c4066d5e&lt;/p&gt;</comment>
                            <comment id="228748" author="pjones" created="Tue, 29 May 2018 10:58:34 +0000"  >&lt;p&gt;Landed for 2.12&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|hzzx3b:</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>