All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sonic Zhang <sonic.zhang@intel.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] About Mark's advice on bug 48
Date: Fri Mar 26 02:27:28 2004	[thread overview]
Message-ID: <4063E97B.7020100@intel.com> (raw)
In-Reply-To: <4063DB4B.6060000@intel.com>

Hi Mark,

Yes, I find the code in ocfs_daemonize() to allow kernel thread to 
receive signals. So, I change the signal process code to make it 
compilable under kernel 2.6. Please check my revise.

Thank you.

This patch is for journal.c.
------------------------------------------------------------------
--- ocfs2.old/src/journal.c.old    2004-03-25 10:44:20.000000000 +0800
+++ ocfs2/src/journal.c    2004-03-26 16:08:19.526750568 +0800
@@ -1745,6 +1745,7 @@
     ocfs_commit_task *commit = osb->commit;
     char name[16];
     ocfs_journal * journal = &osb->journal;
+    siginfo_t info;
 
     sprintf (name, "ocfs2cmt-%d", osb->osb_id);
     ocfs_daemonize (name, strlen(name));
@@ -1765,7 +1766,21 @@
                 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;
+                if (signal_pending(current)) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+                    /* ignore the actual signal */
+                    dequeue_signal_lock(current, &current->blocked, &info);
+#else
+                    spin_lock_irq(&current->sigmask_lock);
+                    /* ignore the actual signal */
+                    dequeue_signal(&current->blocked, &info);
+                    spin_unlock_irq(&current->sigmask_lock);
+#endif
+                }
                 LOG_TRACE_STR("FLUSH_EVENT: interrupted");
                 break;
             case 0:
@@ -1778,7 +1793,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 +1803,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);

  reply	other threads:[~2004-03-26  2:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-26  1:26 [Ocfs2-devel] About Mark's advice on bug 48 Sonic Zhang
2004-03-26  2:27 ` Sonic Zhang [this message]
2004-03-29 14:13   ` Mark Fasheh
2004-03-29 14:28 ` Mark Fasheh
  -- strict thread matches above, loose matches on Subject: below --
2004-03-25  3:26 Sonic Zhang
2004-03-25 13:10 ` Mark Fasheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4063E97B.7020100@intel.com \
    --to=sonic.zhang@intel.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.