About Mark's advice on bug 48
Hi Mark,
I change a little to your patch. I remove the signal prcess code,
because kernel thread doesn't receive signals by default. This patch fixes the halt problem in thread ocfs_submit_thread(). But, there is another dead lock on osb->publish_lock in thread ocfs_volume_thread() and routine ocfs_journal_set_unmounted(). I am tracking this problem now.
Following is the revised patch for journal.c
--------------------------------------------------------------
journal.c 2004-03-25 10:57:53.000000000 +0800 renamed from journal.c.old 2004-03-25 10:44:20.000000000 +0800 +5 -2
@@ -1765,7 +1765,10 @@ LOG_TRACE_STR("FLUSH_EVENT: timed out"); break; case -EINTR: - finish = 1; + /* journal shutdown has asked me to do + * one last commit cache and then exit */ + if (journal->state == OCFS_JOURNAL_IN_SHUTDOWN) + finish = 1; LOG_TRACE_STR("FLUSH_EVENT: interrupted"); break; case 0:
@@ -1778,7 +1781,7 @@ if ((OcfsGlobalCtxt.flags & OCFS_FLAG_SHUTDOWN_VOL_THREAD) || (osb->osb_flags & OCFS_OSB_FLAGS_BEING_DISMOUNTED)) - break; + finish = 1; //if (!osb->needs_flush && status != 0) // continue;
@@ -1788,18 +1791,13 @@ if (down_trylock(&osb->trans_lock) != 0) { LOG_TRACE_ARGS("commit thread: trylock failed, miss=%d\n",
misses);
- if (++misses < OCFS_COMMIT_MISS_MAX)
+ if (++misses < OCFS_COMMIT_MISS_MAX && finish == 0)
continue;
LOG_TRACE_ARGS("commit thread: about to down\n");
down(&osb->trans_lock);
misses = 0;
}- /* journal shutdown has asked me to do one last commit cache */
- /* this commit cache will leave trans lock held! */
- if (journal->state == OCFS_JOURNAL_IN_SHUTDOWN)
- finish = 1;
-
status = ocfs_commit_cache (osb, false);
if (status < 0)
LOG_ERROR_STATUS(status);Quoted 4 lines · Sonic Zhang
Hi Mark,
I change a little to your patch. I remove the signal prcess code,
because kernel thread doesn't receive signals by default.
Ours does! If you look in ocfs_daemonize, you'll see the following:
/* Block all signals except SIGKILL, SIGSTOP, SIGHUP and SIGINT */
#ifdef HAVE_NPTL
spin_lock_irq (¤t->sighand->siglock);
tmpsig = current->blocked;
siginitsetinv (¤t->blocked, SHUTDOWN_SIGS);
recalc_sigpending ();
spin_unlock_irq (¤t->sighand->siglock);You need that signal processing bit, to dequeue pending signals from our task. Otherwise, ocfs_wait will trigger the signal_pending condition and return -EINTR on every call!
Quoted 4 lines
This patch
fixes the halt problem in threadocfs_submit_thread(). But, there is another dead lock onosb->publish_lockin threadocfs_volume_thread()and routineocfs_journal_set_unmounted(). I am tracking this problem now.
I'd like more info on this.
--Mark
--
Mark Fasheh
Software Developer, Oracle Corp
[email protected]