The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Steven French <sfrench@us.ibm.com>
Cc: "young dave" <hidave.darkstar@gmail.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	David Kleikamp <shaggy@us.ibm.com>,
	Shirish S Pargaonkar <shirishp@us.ibm.com>
Subject: Re: 2.6.22-rc1-mm1 cifs_mount oops
Date: Wed, 23 May 2007 09:10:13 -0700	[thread overview]
Message-ID: <20070523091013.b1475211.akpm@linux-foundation.org> (raw)
In-Reply-To: <OF794FED81.D7F8CFC9-ON872572E4.004974FE-862572E4.004A1708@us.ibm.com>

On Wed, 23 May 2007 08:28:47 -0500 Steven French <sfrench@us.ibm.com> wrote:

> Yes - this patch looks better.
> 
> I also am not sure whether the send_sig is still necessary to wake up a 
> thread blocked in tcp recv_msg (only do a wake_up_process vs. doing a 
> send_sig(SIGKILL) )
> 
> Unless someone knows for sure whether the send_sig is redundant, I would 
> like to merge Shaggy's version of the patch
> 
> 
> "young dave" <hidave.darkstar@gmail.com> wrote on 05/23/2007 03:37:04 AM:
> 
> > Hi,
> > Sorry for the wrong patch in my last post.
> > 
> > How about save the tsk then call kthread_stop like this:
> > 
> > diff -udr linux/fs/cifs/connect.c linux.new/fs/cifs/connect.c
> > --- linux/fs/cifs/connect.c     2007-05-23 10:59:13.000000000 +0000
> > +++ linux.new/fs/cifs/connect.c 2007-05-23 16:33:54.000000000 +0000
> > @@ -2069,8 +2069,9 @@
> >                         srvTcp->tcpStatus = CifsExiting;
> >                         spin_unlock(&GlobalMid_Lock);
> >                         if (srvTcp->tsk) {
> > +                               struct task_struct * tsk = srvTcp->tsk;
> >                                 send_sig(SIGKILL,srvTcp->tsk,1);
> > -                               kthread_stop(srvTcp->tsk);
> > +                               kthread_stop(tsk);
> >                         }
> >                 }
> >                  /* If find_unc succeeded then rc == 0 so we can not end 
> */
> > 
> > Regards
> > dave
> 
> Shaggy's suggested patch seems slightly better:
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 216fb62..b6e2158 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -2069,8 +2069,12 @@ cifs_mount(struct super_block *sb, struct 
> cifs_sb_info *cifs_sb,
>                                                  srvTcp->tcpStatus = 
> CifsExiting;
>  spin_unlock(&GlobalMid_Lock);
>                                                  if (srvTcp->tsk) {
> +                                                                struct 
> task_struct *tsk;
>  send_sig(SIGKILL,srvTcp->tsk,1);
> - kthread_stop(srvTcp->tsk);
> +                                                                /* 
> srvTcp->tsk can be zeroed at any time */
> +                                                                tsk = 
> srvTcp->tsk;
> +                                                                if (tsk)
> +  kthread_stop(tsk);
>                                                  }
>                                  }
>                                   /* If find_unc succeeded then rc == 0 so 
> we can not end */

The wordwrapping made that extraordinarily hard to read.  Repairing...

--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -2069,8 +2069,12 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
			srvTcp->tcpStatus = CifsExiting;
			spin_unlock(&GlobalMid_Lock);
			if (srvTcp->tsk) {
				struct  task_struct *tsk;
				send_sig(SIGKILL,srvTcp->tsk,1);
-				kthread_stop(srvTcp->tsk);
+				/*  srvTcp->tsk can be zeroed at any time */
+				tsk = srvTcp->tsk;
+				if (tsk)
+					kthread_stop(tsk);
			}
		}
		/* If find_unc succeeded then rc == 0 so we can not end */


This can end up running kthread_stop() against an already-exited task.


  reply	other threads:[~2007-05-23 16:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23  0:50 2.6.22-rc1-mm1 cifs_mount oops young dave
2007-05-23  2:22 ` Andrew Morton
2007-05-23  2:59   ` young dave
2007-05-23  3:21     ` Andrew Morton
2007-05-23  7:16       ` young dave
2007-05-23  8:37       ` young dave
2007-05-23 13:28         ` Steven French
2007-05-23 16:10           ` Andrew Morton [this message]
2007-05-23 22:14             ` Steven French
2007-05-24  1:05               ` young dave
2007-05-24  2:38                 ` Steven French
2007-05-23 13:56   ` Steven French
  -- strict thread matches above, loose matches on Subject: below --
2007-05-23 14:59 Steve French

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=20070523091013.b1475211.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sfrench@us.ibm.com \
    --cc=shaggy@us.ibm.com \
    --cc=shirishp@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox