James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: > On Wed, 2008-07-02 at 17:59 +0200, Elias Oltmanns wrote: >> James Bottomley <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx> wrote: [...] >> > unless we get down to zero depth in which case the decrements are done >> > under lock. >> >> Sorry, but this simply doesn't resolve the matter at hand. >> scsi_finish_command() can change (host|device)_blocked values to zero at >> any time currently *not* protected by any lock. In much the same way >> scsi_queue_insert() can change these values from zero to something else >> at any time. > > Look more closely at the requirements for the decrements: There have to > be no outstanding commands: nothing can be in scsi_finish_command for > the device (or the host for host_blocked). Yes, I agree as far as the decrements are concerned. There still is the check if (sdev->device_blocked) which can happen while ->device_blocked is changed either by scsi_finish_command() or scsi_queue_insert(). If I understand Matthew and you correctly, this doesn't pose any problem because assigning an int is an atomic operation anyway. Thanks for explaining, Elias -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html