On Thu, Jun 11, 2015 at 10:01:28AM +0200, Hannes Reinecke wrote:
> SAM mandates that an BUS DEVICE RESET FUNCTION OCCURRED
> UA needs to be send after a LUN RESET tmr has completed.
> 
> Signed-off-by: Hannes Reinecke <[email protected]>
> ---
>  drivers/target/target_core_transport.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/target/target_core_transport.c 
> b/drivers/target/target_core_transport.c
> index a0e0d3a..bb60c0c4 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -3064,6 +3064,17 @@ static void target_tmr_work(struct work_struct *work)
>               ret = core_tmr_lun_reset(dev, tmr, NULL, NULL);
>               tmr->response = (!ret) ? TMR_FUNCTION_COMPLETE :
>                                        TMR_FUNCTION_REJECTED;
> +             if (tmr->response == TMR_FUNCTION_COMPLETE) {
> +                     struct se_dev_entry *deve;
> +
> +                     rcu_read_lock();
> +                     deve = target_nacl_find_deve(cmd->se_sess->se_node_acl,
> +                                                  cmd->orig_fe_lun);
> +                     if (deve)
> +                             core_scsi3_ua_allocate(deve, 0x29,
> +                                     
> ASCQ_29H_BUS_DEVICE_RESET_FUNCTION_OCCURRED);
> +                     rcu_read_unlock();

This should use the target_ua_allocate_lun helper.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

Reply via email to