All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
	Christoph Hellwig <hch@infradead.org>,
	Hannes Reinecke <hare@suse.de>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target()
Date: Fri, 2 Oct 2015 05:49:03 -0700	[thread overview]
Message-ID: <20151002124903.GA11987@infradead.org> (raw)
In-Reply-To: <1443774062-15638-1-git-send-email-jthumshirn@suse.de>

> -	list_for_each_entry(starget, &shost->__targets, siblings) {
> +	list_for_each_entry_safe(starget, tmp, &shost->__targets, siblings) {
>  		if (starget->state == STARGET_DEL)
>  			continue;
>  		if (starget->dev.parent == dev || &starget->dev == dev) {
>  			/* assuming new targets arrive at the end */

Now that the last variable is gone this comments isn't needed.

>  			kref_get(&starget->reap_ref);
>  			spin_unlock_irqrestore(shost->host_lock, flags);
> -			if (last)
> -				scsi_target_reap(last);
> -			last = starget;
> +
>  			__scsi_remove_target(starget);
> +			list_move_tail(&starget->siblings, &reap_list);
>  			spin_lock_irqsave(shost->host_lock, flags);
>  		}

What makes the list_move save after dropping host_lock?  I think this
needs to be changed to not drop the host_lock and change
__scsi_remove_target to expect host_lock held to be safe. 

  parent reply	other threads:[~2015-10-02 12:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-02  8:21 [PATCH] SCSI: Fix hard lockup in scsi_remove_target() Johannes Thumshirn
2015-10-02  8:25 ` Hannes Reinecke
2015-10-02 12:49 ` Christoph Hellwig [this message]
2015-10-02 13:09   ` Johannes Thumshirn
2015-10-02 13:09     ` Johannes Thumshirn
2015-10-02 13:16     ` Christoph Hellwig

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=20151002124903.GA11987@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=hare@suse.de \
    --cc=jthumshirn@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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 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.