<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body
        {line-height:1.5}
blockquote
        {margin-top:0px;
        margin-bottom:0px;
        margin-left:0.5em}
p
        {margin-top:0px;
        margin-bottom:0px}
body
        {font-size:16pt;
        font-family:微软雅黑;
        color:rgb(0,128,0);
        line-height:1.5}
-->
</style>
</head>
<body>
<div><font color="#000000">As it is described below,</font><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5; background-color:window">the </span><span style="color:rgb(0,0,0); font-size:16pt; background-color:window; line-height:19px">resource
lock have been released</span></div>
<div><span style="color:rgb(0,0,0); font-size:16pt; background-color:window; line-height:19px">in the function of </span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5">dlmunlock_common
</span><span style="color:rgb(0,0,0); font-size:16pt; line-height:19px; background-color:window">. </span><span style="color:rgb(0,0,0); line-height:19px; font-size:16pt; background-color:window">while dumping the info of lock resource,</span></div>
<div><span style="color:rgb(0,0,0); line-height:19px; font-size:16pt; background-color:window">NULL pointer will access. </span><font color="#000000" style="font-size:16pt; line-height:1.5; background-color:window">This is </font><span style="font-size:16pt; line-height:1.5; background-color:window"><font color="#000000">probably</font></span><span style="font-size:16pt; line-height:1.5; color:rgb(0,0,0); background-color:window"> the
reason.</span></div>
<div><span style="line-height:19px; background-color:rgb(255,255,255)"><font color="#000000"><br>
</font></span></div>
<div><font color="#000000"><span style="line-height:19px">1. A</span><span style="line-height:1.5">s we all know</span></font><span style="font-size:16pt; line-height:1.5; background-color:window"> </span><span style="font-size:16pt; line-height:1.5; color:rgb(0,0,0)">function
stack,</span><font color="#000000" style="font-size:16pt; line-height:1.5; background-color:window"><span style="line-height:19px">ocfs2_dlm_unlock -></span></font><span style="font-size:16pt; line-height:1.5; color:rgb(0,0,0)">dlmunlock-></span><span style="font-size:16pt; line-height:1.5; color:rgb(0,0,0)">dlmunlock_remote</span></div>
<div><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5"> </span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5">-></span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5">dlmunlock_common-></span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5">dlm_send_remote_unlock_request.</span></div>
<div><font color="#000000">2. in dlmunlock _common, </font><span style="line-height:1.5"><font color="#000000">actions may be 11,</font></span></div>
<div><font color="#000000"><span style="line-height:1.5"> actions = (DLM_UNLOCK_FREE_LOCK | </span><span style="line-height:1.5">DLM_UNLOCK_CALL_AST | </span><span style="line-height:1.5">DLM_UNLOCK_REMOVE_LOCK).</span></font></div>
<div><font color="#000000"><span style="line-height:1.5"> </span><span style="line-height:1.5"> but when there is </span></font><span style="font-size:16pt; line-height:1.5; background-color:window"><font color="#000000">probably</font> </span><font color="#000000" style="font-size:16pt; line-height:1.5; background-color:window"><span style="line-height:1.5">the </span></font><font color="#000000" style="font-size:16pt; line-height:1.5; background-color:window"><span style="line-height:1.5">return
value "</span><span style="line-height:19px">DLM_IVLOCKID" </span><span style="line-height:1.5">of</span><span style="line-height:1.5"> </span><span style="line-height:1.5">dlm_send_remote_unlock_reques</span></font><span style="font-size:16pt; line-height:1.5; color:rgb(0,0,0); background-color:window">t, </span></div>
<div><span style="color:rgb(0,0,0)"> the function dlm_lock_put still be called two times for releasing lock resourse </span></div>
<div><span style="color:rgb(0,0,0)"> in the action </span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5; background-color:window">DLM_UNLOCK_FREE_LOCK| </span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5; background-color:window">DLM_UNLOCK_REMOVE_LOCK.</span></div>
<div><font color="#000000"><span style="line-height:1.5">3. </span><span style="line-height:1.5">in</span><span style="line-height:1.5">
</span><span style="line-height:1.5">final</span><span style="line-height:1.5"> processing of </span><span style="line-height:19px">ocfs2_dlm_dump_lksb, NULL pointer and BUG will access.</span></font></div>
<div><font color="#000000"> Such a patch that </font><span style="color:rgb(0,0,0)">described below </span><font color="#000000">should be reasonable,</font></div>
<div>
<div style="line-height:normal"><font color="#000000"> </font><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5"> </span><span style="color:rgb(0,0,0); font-size:16pt; line-height:1.5"> </span><span style="background-color:window; color:rgb(0,0,0); font-size:16pt">Greate
appreciate for anyone's reply.</span></div>
<div style="line-height:normal"><span style="font-size:16pt; color:rgb(0,0,0); background-color:window"> Best Regar</span><span style="font-size:16pt; color:rgb(0,0,0); background-color:window">ds</span></div>
</div>
<div><br>
</div>
<div><span style="line-height:19px"><font color="#000000"> </font></span></div>
<hr color="#b5c4df" size="1" align="left" style="width:210px; height:1px">
<div><span>
<div style="margin:10px; font-family:verdana; font-size:10pt">
<div>zhangguanghui 10102</div>
</div>
</span></div>
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div> </div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<div style="padding-right:8px; padding-left:8px; font-size:12px; font-family:tahoma; color:#000000; background:#efefef; padding-bottom:8px; padding-top:8px">
<div><b>发件人:</b> <a href="mailto:guozhonghua@h3c.com">guozhonghua 02084 (RD)</a></div>
<div><b>发送时间:</b> 2015-05-25 10:43</div>
<div><b>收件人:</b> <a href="mailto:ocfs2-devel@oss.oracle.com">ocfs2-devel@oss.oracle.com</a></div>
<div><b>抄送:</b> <a href="mailto:shi.changkuo@h3c.com">shichangkuo</a>; <a href="mailto:zhang.guanghui@h3c.com">
zhangguanghui 10102 (RD)</a>; <a href="mailto:changlimin@h3c.com">changlimin 00148</a></div>
<div><b>主题:</b> ocfs2 drop lock patch required any reviews, thanks</div>
</div>
</div>
<div>
<div class="FoxDiv20150526091047260067">
<p><font size="2">Hi, All<br>
<br>
As one resource unlocked, or evicted from the fs, the resource lock may had been released in the function ocfs2_dlm_unlock.<br>
But the return code is not zero, dump the info of the lock resource, because the dlm resource lock had been released, so we would have NULL pointer accessed.<br>
Is the BUG call required with ret value is not zero?<br>
<br>
diff -cp dlmglue_org.c dlmglue.c<br>
*** dlmglue_org.c 2015-05-25 10:11:59.086856234 +0800<br>
--- dlmglue.c 2015-05-25 10:13:51.414859206 +0800<br>
*************** static int ocfs2_drop_lock(struct ocfs2_<br>
*** 3140,3147 ****<br>
ret = ocfs2_dlm_unlock(osb->cconn, &lockres->l_lksb, lkm_flags);<br>
if (ret) {<br>
ocfs2_log_dlm_error("ocfs2_dlm_unlock", ret, lockres);<br>
mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags);<br>
- ocfs2_dlm_dump_lksb(&lockres->l_lksb);<br>
- BUG();<br>
}<br>
mlog(0, "lock %s, successful return from ocfs2_dlm_unlock\n",<br>
lockres->l_name);<br>
--- 3140,3145 ----<br>
<br>
<br>
<br>
May 7 09:45:01 FC-07 kernel: [4185225.733003] (ocfs2dc,6401,3):ocfs2_unlock_ast:1129 ERROR: Dlm passes error -22 for lock M000000000000001f89012100000000, unlock_action 2<br>
May 7 09:45:01 FC-07 kernel: [4185225.733022] (ocfs2dc,6401,3):dlmunlock:688 ERROR: dlm status = DLM_IVLOCKID<br>
May 7 09:45:01 FC-07 kernel: [4185225.733028] (ocfs2dc,6401,3):ocfs2_drop_lock:3132 ERROR: DLM error -22 while calling ocfs2_dlm_unlock on resource M000000000000001f89012100000000<br>
May 7 09:45:01 FC-07 kernel: [4185225.733034] (ocfs2dc,6401,3):ocfs2_drop_lock:3133 ERROR: lockres flags: 194<br>
May 7 09:45:01 FC-07 kernel: [4185225.733060] BUG: unable to handle kernel NULL pointer dereference at 00000000000000b0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733065] IP: [<ffffffff8175847e>] _raw_spin_lock+0xe/0x50<br>
May 7 09:45:01 FC-07 kernel: [4185225.733083] PGD 0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733086] Oops: 0002 [#1] SMP<br>
May 7 09:45:01 FC-07 kernel: [4185225.733090] Modules linked in: ip6table_filter(F) ip6_tables(F) iptable_filter(F) ip_tables(F) ebtable_nat(F) ebtables(F) x_tables(F) ocfs2(OF) quota_tree(F) drbd(F) lru_cache(F) 8021q(F) mrp(F) garp(F) stp(F) llc(F) vhost_net(F)
macvtap(F) macvlan(F) vhost(F) kvm_intel(F) kvm(F) ib_iser(F) rdma_cm(F) ib_cm(F) iw_cm(F) ib_sa(F) ib_mad(F) ib_core(F) ib_addr(F) iscsi_tcp(F) libiscsi_tcp(F) libiscsi(F) scsi_transport_iscsi(F) ocfs2_dlmfs(OF) ocfs2_stack_o2cb(OF) ocfs2_dlm(OF) ocfs2_nodemanager(OF)
ocfs2_stackglue(OF) configfs(F) openvswitch(OF) gre(F) nfsd(F) nfs_acl(F) auth_rpcgss(F) nfs(F) fscache(F) lockd(F) dm_round_robin(F) sunrpc(F) ses(F) joydev(F) dm_multipath(F) enclosure(F) scsi_dh(F) gpio_ich(F) psmouse(F) sb_edac(F) ioatdma(F) edac_core(F)
dca(F) serio_raw(F) hpilo(F) hid_generic(F) acpi_power_meter(F) lpc_ich(F) hpwdt(F) mac_hid(F) lp(F) parport(F) usbhid(F) bnx2x(F) hid(F) bfa(F) libcrc32c(F) tg3(F) mdio(F) scsi_transport_fc(F) ptp(F) hpsa(F) scsi_tgt(F) pps_core(F)<br>
May 7 09:45:01 FC-07 kernel: nbd(F) [last unloaded: ipmi_si]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733192] CPU: 3 PID: 6401 Comm: ocfs2dc Tainted: GF W O 3.13.6 #1<br>
May 7 09:45:01 FC-07 kernel: [4185225.733196] Hardware name: H3C FlexServer R390, BIOS P70 02/10/2014<br>
May 7 09:45:01 FC-07 kernel: [4185225.733200] task: ffff882179b68000 ti: ffff8821736d6000 task.ti: ffff8821736d6000<br>
May 7 09:45:01 FC-07 kernel: [4185225.733203] RIP: 0010:[<ffffffff8175847e>] [<ffffffff8175847e>] _raw_spin_lock+0xe/0x50<br>
May 7 09:45:01 FC-07 kernel: [4185225.733210] RSP: 0018:ffff8821736d7a68 EFLAGS: 00010286<br>
May 7 09:45:01 FC-07 kernel: [4185225.733213] RAX: 0000000000020000 RBX: 00000000000000b0 RCX: 0000000000000006<br>
May 7 09:45:01 FC-07 kernel: [4185225.733216] RDX: 0000000000000007 RSI: 0000000000000007 RDI: 00000000000000b0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733220] RBP: ffff8821736d7a68 R08: 0000000000000000 R09: 0000000000000000<br>
May 7 09:45:01 FC-07 kernel: [4185225.733235] R10: 00000000000ee2c3 R11: 00000000000ee2c2 R12: 0000000000000000<br>
May 7 09:45:01 FC-07 kernel: [4185225.733239] R13: ffff884366877228 R14: 00000000ffffffea R15: 0000000000000008<br>
May 7 09:45:01 FC-07 kernel: [4185225.733243] FS: 0000000000000000(0000) GS:ffff8821b7a60000(0000) knlGS:0000000000000000<br>
May 7 09:45:01 FC-07 kernel: [4185225.733247] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033<br>
May 7 09:45:01 FC-07 kernel: [4185225.733250] CR2: 00000000000000b0 CR3: 0000000001c0d000 CR4: 00000000001427e0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733254] Stack:<br>
May 7 09:45:01 FC-07 kernel: [4185225.733256] ffff8821736d7a88 ffffffffa041f2e7 ffff8843668771b8 ffff884366877224<br>
May 7 09:45:01 FC-07 kernel: [4185225.733264] ffff8821736d7a98 ffffffffa041f322 ffff8821736d7aa8 ffffffffa029a072<br>
May 7 09:45:01 FC-07 kernel: [4185225.733268] ffff8821736d7ab8 ffffffffa0267077 ffff8821736d7b78 ffffffffa05ebbfa<br>
May 7 09:45:01 FC-07 kernel: [4185225.733272] Call Trace:<br>
May 7 09:45:01 FC-07 kernel: [4185225.733284] [<ffffffffa041f2e7>] dlm_print_one_lock_resource+0x27/0x50 [ocfs2_dlm]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733290] [<ffffffffa041f322>] dlm_print_one_lock+0x12/0x20 [ocfs2_dlm]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733294] [<ffffffffa029a072>] o2cb_dump_lksb+0x12/0x20 [ocfs2_stack_o2cb]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733299] [<ffffffffa0267077>] ocfs2_dlm_dump_lksb+0x17/0x20 [ocfs2_stackglue]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733335] [<ffffffffa05ebbfa>] ocfs2_drop_lock.isra.17+0x3ca/0x6c0 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733346] [<ffffffffa05e9f6b>] ? ocfs2_init_mask_waiter+0x3b/0x50 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733358] [<ffffffffa05f3b02>] ? ocfs2_extent_map_trunc+0x112/0x140 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733369] [<ffffffffa05ed493>] ocfs2_drop_inode_locks+0x73/0x260 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733379] [<ffffffffa05f3b02>] ? ocfs2_extent_map_trunc+0x112/0x140 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733391] [<ffffffffa05fe1ae>] ocfs2_evict_inode+0x18e/0x21d0 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733397] [<ffffffff811ea9c5>] ? __inode_wait_for_writeback+0x65/0xc0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733404] [<ffffffff810adba0>] ? wake_atomic_t_function+0x40/0x40<br>
May 7 09:45:01 FC-07 kernel: [4185225.733410] [<ffffffff811dc7a8>] evict+0xb8/0x1c0<br>
May 7 09:45:01 FC-07 kernel: [4185225.733412] [<ffffffff811dd095>] iput+0x105/0x190<br>
May 7 09:45:01 FC-07 kernel: [4185225.733422] [<ffffffffa05ded59>] ocfs2_dentry_lock_put+0x59/0x90 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733431] [<ffffffffa05ea87a>] ocfs2_dentry_post_unlock+0x1a/0x20 [ocfs2]<br>
May 7 09:45:01 FC-07 kernel: [4185225.733442] [<ffffffffa05f0891>] ocfs2_process_blocked_lock+0xa1/0x950 [ocfs2]<br>
</font></p>
</div>
</div>
</blockquote>
<span style="font-size:7.5pt; font-family:华文细黑; color:gray"><span lang="EN-US">-------------------------------------------------------------------------------------------------------------------------------------<br>
</span>本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出<span lang="EN-US"><br>
</span>的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、<span lang="EN-US"><br>
</span>或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本<span lang="EN-US"><br>
</span>邮件!<span lang="EN-US"><br>
</span></span><span lang="EN-US" style="font-size:7.5pt; font-family:"Arial","sans-serif"; color:gray">This e-mail and its attachments contain confidential information from H3C, which is
<br>
intended only for the person or entity whose address is listed above. Any use of the
<br>
information contained herein in any way (including, but not limited to, total or partial
<br>
disclosure, reproduction, or dissemination) by persons other than the intended <br>
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
<br>
by phone or email immediately and delete it!</span>
</body>
</html>