Re: [RFC][PATCH] limit state change to SDEV_BLOCK devices in scsi_internal_device_unblock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Matthew Wilcox wrote:
> On Mon, Apr 27, 2009 at 07:52:57PM -0400, Takahiro Yasui wrote:
>> James Bottomley wrote:
>>>> +	if (sdev->sdev_state != SDEV_BLOCK)
>>> This isn't quite correct.  There are two blocked states in the model
>>> currently:  SDEV_BLOCK and SDEV_CREATED_BLOCK ... you'd need to check
>>> for both of them
>>>
>>>> +		return 0;
>>> Traditionally the return for an attempted invalid state transition is
>>> -EINVAL.
>>>
>>> I suppose for lower down, if you check the state, now we know we go 
>>>
>>> SDEV_CREATED_BLOCK -> SDEV_CREATED
>>>
>>> or
>>>
>>> SDEV_BLOCK -> SDEV_RUNNING
>>>
>>> so there's no need for the dual scsi_device_set_state.
>> Thank you for the comments. If I understand your comments correctly, 
>> the state transition is better to be defined in scsi_device_set_state(),
>> and both transitions, "SDEV_CREATED_BLOCK -> SDEV_CREATED" and
>> "SDEV_BLOCK -> SDEV_RUNNING" need to be covered. I updated the patch
>> so that the transition of "SDEV_OFFLINE -> SDEV_RUNNING" is prohibited.
> 
> I don't think that's what he meant.  I think he meant something more like:

Thanks a lot. I'll build a patch and send it.

Regards,
---
Takahiro Yasui
Hitachi Computer Products (America), Inc.
--
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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux