Zhang, Sonic
2004-Mar-29 20:53 UTC
[Ocfs2-devel] Can you check the patch for bug 48 and commit?
Hi Mark, Can you check the patch for bug 48 in the attachment and commit? I haven't found it in the svn tree. This patch adds lines of signal process code, which makes the thread ocfs_volume_thread() really go to sleep after receive the SIGTERM signal. So, it gives routine ocfs_journal_set_unmounted() a chance to run and check the lock status before thread ocfs_volume_thread() wakes up. Thanks. ********************************************* Sonic Zhang Software Engineer Intel China Software Lab Tel: (086)021-52574545-1667 iNet: 752-1667 ********************************************* -----Original Message----- From: ocfs2-devel-bounces@oss.oracle.com [mailto:ocfs2-devel-bounces@oss.oracle.com] On Behalf Of Zhang, Sonic Sent: 2004Äê3ÔÂ29ÈÕ 11:41 To: joel.becker@oracle.com Cc: ocfs2-devel Subject: RE: [Ocfs2-devel] resend the new patch for bug 48 to remove incorrectautowrap in last mail Hi, I failed to prevent Mozilla from converting the TABs to Spaces. So, I have to send the patch in attachment. ********************************************* Sonic Zhang Software Engineer Intel China Software Lab Tel: (086)021-52574545-1667 iNet: 752-1667 ********************************************* -----Original Message----- From: joel.becker@oracle.com [mailto:joel.becker@oracle.com] Sent: 2004Äê3ÔÂ27ÈÕ 10:18 To: Zhang, Sonic Cc: ocfs2-devel Subject: Re: [Ocfs2-devel] resend the new patch for bug 48 to remove incorrect autowrap in last mail Sonic, Please, send in proper kernel style. TABs, not spaces. Joel On Sat, Mar 27, 2004 at 10:00:47AM +0800, Sonic Zhang wrote:> --- ocfs2.old/src/nm.c.old 2004-03-26 15:21:32.000000000 +0800 > +++ ocfs2/src/nm.c 2004-03-27 09:22:06.176266560 +0800 > @@ -119,6 +119,8 @@ > OcfsIpcCtxt.recv_sock = NULL; > } > > + OcfsIpcCtxt.task = NULL; > + > /* signal main thread of ipcdlm's exit */ > complete (&(OcfsIpcCtxt.complete)); > > @@ -250,6 +252,7 @@ > __u64 cfg_seq_num; > int which, pruned, prune_iters = 0; > struct buffer_head *bh = NULL; > + siginfo_t info; > > LOG_ENTRY (); > > @@ -409,6 +412,7 @@ > OCFS_BH_PUT_DATA(bh); > status = ocfs_write_bh(osb, bh, 0, NULL); > if (status < 0) { > + up(&(osb->publish_lock)); > LOG_ERROR_STATUS (status); > goto finally; > } > @@ -439,6 +443,18 @@ > } > set_current_state (TASK_INTERRUPTIBLE); > schedule_timeout (osb->hbt - j); > + > + if (signal_pending(current)) { > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) > + /* ignore the actual signal */ > + dequeue_signal_lock(current, ¤t->blocked, &info); > +#else > + spin_lock_irq(¤t->sigmask_lock); > + /* ignore the actual signal */ > + dequeue_signal(¤t->blocked, &info); > + spin_unlock_irq(¤t->sigmask_lock); > +#endif > + } > } > > /* Flush all scheduled tasks */ > > > _______________________________________________ > Ocfs2-devel mailing list > Ocfs2-devel@oss.oracle.com > http://oss.oracle.com/mailman/listinfo/ocfs2-devel-- "Nothing is wrong with California that a rise in the ocean level wouldn't cure." - Ross MacDonald Joel Becker Senior Member of Technical Staff Oracle Corporation E-mail: joel.becker@oracle.com Phone: (650) 506-8127 -------------- next part -------------- A non-text attachment was scrubbed... Name: ocfs2-nm-reboot1.patch Type: application/octet-stream Size: 1171 bytes Desc: ocfs2-nm-reboot1.patch Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20040330/22864a07/ocfs2-nm-reboot1.obj
Mark Fasheh
2004-Mar-29 21:10 UTC
[Ocfs2-devel] Can you check the patch for bug 48 and commit?
On Tue, Mar 30, 2004 at 10:53:13AM +0800, Zhang, Sonic wrote:> Hi Mark, > > Can you check the patch for bug 48 in the attachment and commit? I haven't > found it in the svn tree.That's because I was still looking at the signals part of the patch :) I needed to do some reading in schedule() to make sure what I though was going on, really is. Also, I think the correct approach is to do both, the signal handling, *and* to define the timeout value itself as a function of HZ, rather than a hard number of jiffies.> This patch adds lines of signal process code, which makes the thread > ocfs_volume_thread() really go to sleep after receive the SIGTERM signal. > So, it gives routine ocfs_journal_set_unmounted() a chance to run and > check the lock status before thread ocfs_volume_thread() wakes up.You need to update from cvs because half of that patch is already in. Also, can you make the same NPTL fix in it that I did for ocfs_commit_thread? See the svn logs to know what I'm talking about. --Mark -- Mark Fasheh Software Developer, Oracle Corp mark.fasheh@oracle.com
Zhang, Sonic
2004-Mar-30 22:10 UTC
[Ocfs2-devel] Can you check the patch for bug 48 and commit?
Hi Mark, OK, I made the same NPTL fix. Please see the attachment. ------------------------------------------------------------- --- ocfs2.old/src/nm.c 2004-03-31 12:02:10.075066064 +0800 +++ ocfs2/src/nm.c 2004-03-31 12:02:09.973081568 +0800 @@ -254,6 +254,7 @@ __u64 cfg_seq_num; int which, pruned, prune_iters = 0; struct buffer_head *bh = NULL; + siginfo_t info; LOG_ENTRY (); @@ -444,6 +445,19 @@ } set_current_state (TASK_INTERRUPTIBLE); schedule_timeout (osb->hbt - j); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) + dequeue_signal_lock(current, ¤t->blocked, &info); +#else +#ifdef HAVE_NPTL + spin_lock_irq(¤t->sighand->siglock); + dequeue_signal(¤t->blocked, &info); + spin_unlock_irq(¤t->sighand->siglock); +#else + spin_lock_irq(¤t->sigmask_lock); + dequeue_signal(¤t->blocked, &info); + spin_unlock_irq(¤t->sigmask_lock); +#endif /* !HAVE_NPTL */ +#endif /* 2.4.x kernel */ } /* Flush all scheduled tasks */ ********************************************* Sonic Zhang Software Engineer Intel China Software Lab Tel: (086)021-52574545-1667 iNet: 752-1667 ********************************************* -----Original Message----- From: Mark Fasheh [mailto:mark.fasheh@oracle.com] Sent: 2004Äê3ÔÂ30ÈÕ 11:11 To: Zhang, Sonic Cc: Ocfs2-Devel Subject: Re: [Ocfs2-devel] Can you check the patch for bug 48 and commit? On Tue, Mar 30, 2004 at 10:53:13AM +0800, Zhang, Sonic wrote:> Hi Mark, > > Can you check the patch for bug 48 in the attachment and commit? I haven't > found it in the svn tree.That's because I was still looking at the signals part of the patch :) I needed to do some reading in schedule() to make sure what I though was going on, really is. Also, I think the correct approach is to do both, the signal handling, *and* to define the timeout value itself as a function of HZ, rather than a hard number of jiffies.> This patch adds lines of signal process code, which makes the thread > ocfs_volume_thread() really go to sleep after receive the SIGTERM signal. > So, it gives routine ocfs_journal_set_unmounted() a chance to run and > check the lock status before thread ocfs_volume_thread() wakes up.You need to update from cvs because half of that patch is already in. Also, can you make the same NPTL fix in it that I did for ocfs_commit_thread? See the svn logs to know what I'm talking about. --Mark -- Mark Fasheh Software Developer, Oracle Corp mark.fasheh@oracle.com -------------- next part -------------- A non-text attachment was scrubbed... Name: ocfs2-nm-reboot2.patch Type: application/octet-stream Size: 884 bytes Desc: ocfs2-nm-reboot2.patch Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20040331/7280d7ff/ocfs2-nm-reboot2.obj
Mark Fasheh
2004-Apr-02 12:54 UTC
[Ocfs2-devel] Can you check the patch for bug 48 and commit?
On Wed, Mar 31, 2004 at 12:10:22PM +0800, Zhang, Sonic wrote:> Hi Mark, > > OK, I made the same NPTL fix. > Please see the attachment.You lost the if (signal_pending(current)) line! I fixed it myself. --Mark -- Mark Fasheh Software Developer, Oracle Corp mark.fasheh@oracle.com