• Robert Jennings's avatar
    [SCSI] sr: fix sr_drive_status handling when initialization required · b8479178
    Robert Jennings authored
    An sr device that reports sense data with SK/ASC/ASCQ of 2/4/2 (Not ready,
    Logical unit not ready, Initializing command required) will be handled
    in sr_drive_status as (2/4/!1) and assumed to be a 'format in progress'
    which returns CDS_DISC_OK.  The drive will not be made ready in this case.
    
    Prior to 210ba1d1 sr_drive_status would
    have returned CDS_TRAY_OPEN and this results in an START_STOP_UNIT to
    close the tray, which resolves the initialization requirement.
    
    This patch adds handling for SK/ASC/ASCQ of 2/4/2 where it will return
    CDS_TRAY_OPEN as a means of triggering a START_STOP_UNIT.
    
    This issue is seen on the IBM POWER platform when using a file-backed,
    virtual optical device.  The device does not support media queries
    through the Get Event Status Notification command which could otherwise
    trigger a START_STOP_UNIT call to close an open tray.
    Signed-off-by: default avatarRobert Jennings <rcj@linux.vnet.ibm.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    b8479178
sr_ioctl.c 15.1 KB