From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: James Bottomley <jejb@linux.vnet.ibm.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
"Ewan D. Milne" <emilne@redhat.com>,
Hannes Reinecke <hare@suse.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-usb@vger.kernel.org, linux-next@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Xiong Zhou <jencce.kernel@gmail.com>
Subject: Re: [-next] BUG_ON in scsi_target_destroy()
Date: Thu, 14 Apr 2016 11:07:52 +0900 [thread overview]
Message-ID: <20160414020752.GA516@swordfish> (raw)
In-Reply-To: <1460560474.2322.3.camel@linux.vnet.ibm.com>
Hello,
On (04/13/16 08:14), James Bottomley wrote:
[..]
> How about good grief no! A device with multiple targets will get it's
> lists screwed with this
>
> The STARGET_REMOVE state you added only applies to the case we're
> trying to kill a target. In the natural operation case, which is what
> everyone else is running into, we will try to remove a running target
> when it has no more scsi devices left on it. So the correct patch
> should be to make the BUG_ON see this:
works for me.
Reported-and-tested-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
-ss
> James
>
> ---
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 27df7e7..e0a78f5 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -319,8 +319,7 @@ static void scsi_target_destroy(struct scsi_target *starget)
> struct Scsi_Host *shost = dev_to_shost(dev->parent);
> unsigned long flags;
>
> - BUG_ON(starget->state != STARGET_REMOVE &&
> - starget->state != STARGET_CREATED);
> + BUG_ON(starget->state == STARGET_DEL);
> starget->state = STARGET_DEL;
> transport_destroy_device(dev);
> spin_lock_irqsave(shost->host_lock, flags);
>
next prev parent reply other threads:[~2016-04-14 2:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 9:01 [-next] BUG_ON in scsi_target_destroy() Sergey Senozhatsky
2016-04-13 8:41 ` Johannes Thumshirn
2016-04-13 14:47 ` Sergey Senozhatsky
2016-04-13 13:59 ` Johannes Thumshirn
2016-04-13 15:14 ` James Bottomley
2016-04-14 2:07 ` Sergey Senozhatsky [this message]
2016-04-15 5:53 ` Xiong Zhou
2016-04-15 20:55 ` Martin K. Petersen
2016-04-15 4:31 ` Xiong Zhou
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=20160414020752.GA516@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=emilne@redhat.com \
--cc=hare@suse.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jencce.kernel@gmail.com \
--cc=jthumshirn@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=sfr@canb.auug.org.au \
/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).