[Ocfs2-tools-devel] [Ocfs2-tools] [PATCH 1/1] o2hb doesn't not exit when fsck uncleanly device

Shichangkuo shi.changkuo at h3c.com
Tue Apr 5 01:36:32 PDT 2016


Hi Srinivas,
    When I run fsck to recover an unclean device, I find that the o2hb thread doesn't exit.  The version is 1.8.4, and I also find the same issue on other versions.
    After reviewing codes, re-open device will make ost->ost_fs->fs_dlm_ctxt change to NULL after replayed journals. At the end of code, it will determines whether to exit dlm and o2hb by this pointer.
    Recording the pointer will solve the issue.

diff -up a/ocfs2-tools/libocfs2/openfs.c b/ocfs2-tools/libocfs2/openfs.c
--- a/ocfs2-tools/libocfs2/openfs.c
+++ b/ocfs2-tools/libocfs2/openfs.c
@@ -464,6 +464,8 @@
                  ptr += 2;
        }
+       if (*ret_fs && (*ret_fs)->fs_dlm_ctxt)
+                fs->fs_dlm_ctxt = (*ret_fs)->fs_dlm_ctxt;
        *ret_fs = fs;
        return 0;

BTW: why should we open the device twice in this scene?

-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://oss.oracle.com/pipermail/ocfs2-tools-devel/attachments/20160405/39a37054/attachment.html 


More information about the Ocfs2-tools-devel mailing list