• Christof Schmitt's avatar
    [SCSI] zfcp: Allow running unit/LUN shutdown without acquiring reference · fdbd1c5e
    Christof Schmitt authored
    With the change for the LUN data to be part of the scsi_device, the
    slave_destroy callback will be the final call to the
    zfcp_erp_unit_shutdown function. The erp tries to acquire a reference
    to run the action asynchronously and fail, if it cannot get the
    reference. But calling scsi_device_get from slave_destroy will fail,
    because the scsi_device is already in the state SDEV_DEL.
    
    Introduce a new call into the zfcp erp to solve this: The function
    zfcp_erp_unit_shutdown_wait will close the LUN and wait for the erp to
    finish without acquiring an additional reference. The wait allows to
    omit the reference; the caller waiting for the erp to finish already
    has a reference that holds the struct in place.
    Reviewed-by: default avatarSwen Schillig <swen@vnet.ibm.com>
    Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    fdbd1c5e
zfcp_ext.h 8.69 KB