The patch titled Subject: ocfs2: fix BUG when o2hb_register_callback fails has been added to the -mm tree. Its filename is ocfs2-fix-bug-when-o2hb_register_callback-fails.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-fix-bug-when-o2hb_register_callback-fails.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-fix-bug-when-o2hb_register_callback-fails.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joseph Qi <joseph.qi@xxxxxxxxxx> Subject: ocfs2: fix BUG when o2hb_register_callback fails In dlm_register_domain_handlers, if o2hb_register_callback fails, it will call dlm_unregister_domain_handlers to unregister. This will trigger the BUG_ON in o2hb_unregister_callback because hc_magic is 0. So we should call o2hb_setup_callback to initialize hc first. Signed-off-by: Joseph Qi <joseph.qi@xxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/dlm/dlmdomain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff -puN fs/ocfs2/dlm/dlmdomain.c~ocfs2-fix-bug-when-o2hb_register_callback-fails fs/ocfs2/dlm/dlmdomain.c --- a/fs/ocfs2/dlm/dlmdomain.c~ocfs2-fix-bug-when-o2hb_register_callback-fails +++ a/fs/ocfs2/dlm/dlmdomain.c @@ -1725,12 +1725,13 @@ static int dlm_register_domain_handlers( o2hb_setup_callback(&dlm->dlm_hb_down, O2HB_NODE_DOWN_CB, dlm_hb_node_down_cb, dlm, DLM_HB_NODE_DOWN_PRI); + o2hb_setup_callback(&dlm->dlm_hb_up, O2HB_NODE_UP_CB, + dlm_hb_node_up_cb, dlm, DLM_HB_NODE_UP_PRI); + status = o2hb_register_callback(dlm->name, &dlm->dlm_hb_down); if (status) goto bail; - o2hb_setup_callback(&dlm->dlm_hb_up, O2HB_NODE_UP_CB, - dlm_hb_node_up_cb, dlm, DLM_HB_NODE_UP_PRI); status = o2hb_register_callback(dlm->name, &dlm->dlm_hb_up); if (status) goto bail; _ Patches currently in -mm which might be from joseph.qi@xxxxxxxxxx are ocfs2-fix-race-between-dio-and-recover-orphan.patch ocfs2-fix-several-issues-of-append-dio.patch ocfs2-do-not-bug-if-buffer-not-uptodate-in-__ocfs2_journal_access.patch ocfs2-clean-up-unused-local-variables-in-ocfs2_file_write_iter.patch ocfs2-adjust-code-to-match-locking-unlocking-order.patch ocfs2-remove-unneeded-code-in-ocfs2_dlm_init.patch ocfs2-fix-bug-when-o2hb_register_callback-fails.patch ocfs2-remove-unneeded-code-in-dlm_register_domain_handlers.patch ocfs2-fix-race-between-crashed-dio-and-rm.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html