Re: [PATCH v3] scsi: libsas: defer ata device eh commands to libata

2018-03-12 Thread Martin K. Petersen

Jason,

> When ata device doing EH, some commands still attached with tasks are not
> passed to libata when abort failed or recover failed, so libata did not
> handle these commands. After these commands done, sas task is freed, but
> ata qc is not freed. This will cause ata qc leak and trigger a warning
> like below:

Applied to 4.16/scsi-fixes. Thank you!

-- 
Martin K. Petersen  Oracle Linux Engineering


Re: [PATCH v3] scsi: libsas: defer ata device eh commands to libata

2018-03-07 Thread Dan Williams
On Wed, Mar 7, 2018 at 6:34 PM, Jason Yan  wrote:
> When ata device doing EH, some commands still attached with tasks are not
> passed to libata when abort failed or recover failed, so libata did not
> handle these commands. After these commands done, sas task is freed, but
> ata qc is not freed. This will cause ata qc leak and trigger a warning
> like below:
>
> WARNING: CPU: 0 PID: 28512 at drivers/ata/libata-eh.c:4037
> ata_eh_finish+0xb4/0xcc
> CPU: 0 PID: 28512 Comm: kworker/u32:2 Tainted: G W  OE 4.14.0#1
> ..
> Call trace:
> [] ata_eh_finish+0xb4/0xcc
> [] ata_do_eh+0xc4/0xd8
> [] ata_std_error_handler+0x44/0x8c
> [] ata_scsi_port_error_handler+0x480/0x694
> [] async_sas_ata_eh+0x4c/0x80
> [] async_run_entry_fn+0x4c/0x170
> [] process_one_work+0x144/0x390
> [] worker_thread+0x144/0x418
> [] kthread+0x10c/0x138
> [] ret_from_fork+0x10/0x18
>
> If ata qc leaked too many, ata tag allocation will fail and io blocked
> for ever.
>
> As suggested by Dan Williams, defer ata device commands to libata and
> merge sas_eh_finish_cmd() with sas_eh_defer_cmd(). libata will handle
> ata qcs correctly after this.
>
> Signed-off-by: Jason Yan 
> CC: Xiaofei Tan 
> CC: John Garry 
> CC: Dan Williams 

Looks good,

Reviewed-by: Dan Williams