linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BLIST_SINGLELUN
@ 2014-03-18 14:28 Christoph Hellwig
  2014-03-19 15:42 ` BLIST_SINGLELUN Hannes Reinecke
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2014-03-18 14:28 UTC (permalink / raw)
  To: linux-scsi

Does anyone still have a device listed in the blacklist with
BLIST_SINGLELUN?

>From reading the source code I'm not sure the code actually works as
expected currently, or did for a long time.

While scsi_target_queue_ready makes sure to only queue commands to the
right lun as long as starget_sdev_user is set, scsi_single_lun_run
clears starget_sdev_user as soon as the any command completes on a
target marked with the flag, allowing the following situation:

 - cmd 1 lun 0		submitted
 - cmd 2 lun 0		submitted
 - cmd 1 lun 0		completed
 - cmd 9 lun 1		submitted

and thus having commands for two luns in flight at the same time
if we hit the narrow enough race of entering the scsi_request_fn
for lun 1 before scsi_single_lun_run does so for lun 0.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: BLIST_SINGLELUN
  2014-03-18 14:28 BLIST_SINGLELUN Christoph Hellwig
@ 2014-03-19 15:42 ` Hannes Reinecke
  0 siblings, 0 replies; 2+ messages in thread
From: Hannes Reinecke @ 2014-03-19 15:42 UTC (permalink / raw)
  To: Christoph Hellwig, linux-scsi

On 03/18/2014 03:28 PM, Christoph Hellwig wrote:
> Does anyone still have a device listed in the blacklist with
> BLIST_SINGLELUN?
> 
> From reading the source code I'm not sure the code actually works as
> expected currently, or did for a long time.
> 
> While scsi_target_queue_ready makes sure to only queue commands to the
> right lun as long as starget_sdev_user is set, scsi_single_lun_run
> clears starget_sdev_user as soon as the any command completes on a
> target marked with the flag, allowing the following situation:
> 
>  - cmd 1 lun 0		submitted
>  - cmd 2 lun 0		submitted
>  - cmd 1 lun 0		completed
>  - cmd 9 lun 1		submitted
> 
> and thus having commands for two luns in flight at the same time
> if we hit the narrow enough race of entering the scsi_request_fn
> for lun 1 before scsi_single_lun_run does so for lun 0.

You know what, I've been looking at that, too.
And indeed, it looks like you're right.

I do wonder, though, why we don't do away with the
starget_sdev_user and just set max_target_blocked to 1 ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-19 15:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-18 14:28 BLIST_SINGLELUN Christoph Hellwig
2014-03-19 15:42 ` BLIST_SINGLELUN Hannes Reinecke

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).