Re: [PATCH v6 02/12] scsi: Alter handling of RQF_DV requests

Bart Van Assche
2018-08-10T15:07:00Z

On Fri, 2018-08-10 at 09:20 +0800, Ming Lei wrote:
> On Thu, Aug 09, 2018 at 12:41:39PM -0700, Bart Van Assche wrote:
> > Process all requests in state SDEV_CREATED instead of only =
RQF_DV
> > requests. This does not change the behavior of the SCSI core be=
cause
> > the SCSI device state is modified into another state before SCS=
I
> > devices become visible in sysfs and before any device nodes are
> > created in /dev. Do not process RQF_DV requests in state SD=
EV_CANCEL
> > because only power management requests should be processed in t=
his
> > state.
>=20
> Could you explain a bit why only PM requests should be processed in
> SDEV_CANCEL?

Hi Ming,

There is only one function that changes the device state into SDEV_CANC=
EL,
namely __scsi_remove_device(). I think that in the SDEV_C=
ANCEL state all
newly queued requests should be ignored except the SYNCHRONIZE CACHE and
STOP commands submitted by sd_shutdown(). More information about the SC=
SI
device states is available in the commit message of 9b22a8fb0edd ("Upda=
ted
state model for SCSI devices").

Bart.