linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	joseph.salisbury@canonical.com, Nagalakshmi.Nandigama@lsi.com,
	Sreekanth.Reddy@lsi.com, rientjes@google.com,
	akpm@linux-foundation.org, torvalds@linux-foundation.org,
	tj@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org,
	kernel-team@lists.ubuntu.com, linux-scsi@vger.kernel.org,
	thenzl@redhat.com
Subject: Re: please fix FUSION (Was: [v3.13][v3.14][Regression]kthread:makekthread_create()killable)
Date: Mon, 24 Mar 2014 18:01:15 +0100	[thread overview]
Message-ID: <20140324170115.GA30307@redhat.com> (raw)
In-Reply-To: <1395521330.2143.51.camel@dabdike.int.hansenpartnership.com>

On 03/22, James Bottomley wrote:
>
> OK, the fix from the SCSI point of view is to make the mpt teardown path
> actually work.  The whole thing looks to be a complete mess because
> there's another place where it will do the wrong thing in
> mptscsih_remove().  You always have to call mpt_detach() otherwise the
> device doesn't get removed from the lists.  In theory this patch fixes
> both bugs in the driver.

Yes, I obviously thought about the same change ;)

But note that mpt_detach() doesn't look correct too. This is almost
off-topic, but still...

At least it needs s/cancel_delayed_work/cancel_delayed_work_sync/ to
sync with mpt_fault_reset_work().

And it is not clear if it is safe to simply destroy ->fw_event_q,
perhaps it can't have the pending works if the caller is teardown
path, and otherwise we rely on mptsas_cleanup_fw_event_q(), I do
not know... but mptsas_cleanup_fw_event_q() needs _sync too I guess,
and obviously mptsas_free_fw_event() should be called unconditionally.

OTOH, mpt_attach() doesn't verify that ->fw_event_q was created
succesfully. And, if mpt_do_ioc_recovery() fails it destroys
->reset_work_q but not ->fw_event_q. Looks like this driver needs
some cleanups.

> --- a/drivers/message/fusion/mptscsih.c
> +++ b/drivers/message/fusion/mptscsih.c
> @@ -1176,10 +1176,14 @@ mptscsih_remove(struct pci_dev *pdev)
>  	MPT_SCSI_HOST		*hd;
>  	int sz1;
>
> +	if (!host)
> +		/* not brought up far enough to do scsi_host_attach() */
                                                   ^^^^^^^^^^^^^^^^
scsi_host_alloc ;)

> +		goto out;
> +

Yes, I think this is correct. mpt_attach() does kzalloc(MPT_ADAPTER) so
we can probably rely on ->sh == NULL if _alloc failed.

Oleg.


  reply	other threads:[~2014-03-24 17:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 20:46 [v3.13][v3.14][Regression] kthread: make kthread_create() killable Joseph Salisbury
2014-03-15  0:43 ` Tetsuo Handa
2014-03-16 15:13   ` Tetsuo Handa
2014-03-16 16:25     ` Oleg Nesterov
2014-03-17 12:38       ` [v3.13][v3.14][Regression] kthread: make kthread_create()killable Tetsuo Handa
2014-03-17 14:22         ` Oleg Nesterov
2014-03-18 12:03           ` [v3.13][v3.14][Regression] kthread: makekthread_create()killable Tetsuo Handa
2014-03-18 17:16             ` Oleg Nesterov
2014-03-19 11:49               ` [v3.13][v3.14][Regression] kthread:makekthread_create()killable Tetsuo Handa
2014-03-19 16:13                 ` Joseph Salisbury
2014-03-19 17:52                   ` Oleg Nesterov
2014-03-19 18:29                     ` please fix FUSION (Was: [v3.13][v3.14][Regression] kthread:makekthread_create()killable) Oleg Nesterov
2014-03-19 19:42                       ` Oleg Nesterov
2014-03-19 21:04                         ` Joseph Salisbury
2014-03-20 16:46                         ` Joseph Salisbury
2014-03-20 19:23                           ` Oleg Nesterov
2014-03-21 18:34                             ` Oleg Nesterov
2014-03-21 19:32                               ` Linus Torvalds
2014-03-21 20:31                                 ` Oleg Nesterov
2014-03-21 22:56                                 ` James Bottomley
2014-03-22  6:25                               ` please fix FUSION (Was: [v3.13][v3.14][Regression]kthread:makekthread_create()killable) Tetsuo Handa
2014-03-22 19:25                                 ` Oleg Nesterov
2014-03-22 20:48                                   ` James Bottomley
2014-03-24 17:01                                     ` Oleg Nesterov [this message]
2014-03-22 21:25                                   ` Thomas Gleixner
2014-03-22 22:01                                     ` Thomas Gleixner
2014-03-22 23:57                                       ` please fix FUSION (Was:[v3.13][v3.14][Regression]kthread:makekthread_create()killable) Tetsuo Handa
2014-03-23  8:04                                         ` Thomas Gleixner
2014-03-23 14:19                                           ` James Bottomley
2014-03-23 14:28                                             ` Thomas Gleixner
2014-03-23 14:29                                               ` James Bottomley
2014-03-22 23:50                                   ` Tetsuo Handa
2014-03-17 20:02 ` [v3.13][v3.14][Regression] kthread: make kthread_create() killable Andrew Morton
2014-03-17 20:19   ` Oleg Nesterov
2014-03-17 20:39     ` Andrew Morton
2014-03-18 17:45       ` Oleg Nesterov
2014-06-03 13:03     ` [PATCH] kthread: Fix return value of kthread_create() upon SIGKILL Tetsuo Handa
2014-06-03 21:35       ` David Rientjes
2014-03-17 21:32   ` [v3.13][v3.14][Regression] kthread: make kthread_create()killable Tetsuo Handa
2014-03-17 23:18   ` [v3.13][v3.14][Regression] kthread: make kthread_create() killable One Thousand Gnomes
2014-03-18 17:50     ` Oleg Nesterov

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=20140324170115.GA30307@redhat.com \
    --to=oleg@redhat.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sreekanth.Reddy@lsi.com \
    --cc=akpm@linux-foundation.org \
    --cc=joseph.salisbury@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=rientjes@google.com \
    --cc=tglx@linutronix.de \
    --cc=thenzl@redhat.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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;
as well as URLs for NNTP newsgroup(s).