Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238167

Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target()

From Christoph Hellwig <hch@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target()
Date 2015-10-02 14:50 +0200
Message-ID <qf7WG-3Cy-9@gated-at.bofh.it> (permalink)
References <qf3T3-6kK-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> -	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. 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] SCSI: Fix hard lockup in scsi_remove_target() Johannes Thumshirn <jthumshirn@suse.de> - 2015-10-02 10:30 +0200
  Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target() Hannes Reinecke <hare@suse.de> - 2015-10-02 10:30 +0200
  Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target() Christoph Hellwig <hch@infradead.org> - 2015-10-02 14:50 +0200
    Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target() Johannes Thumshirn <jthumshirn@suse.de> - 2015-10-02 15:10 +0200
      Re: [PATCH] SCSI: Fix hard lockup in scsi_remove_target() Christoph Hellwig <hch@infradead.org> - 2015-10-02 15:20 +0200

csiph-web