android_kernel_oneplus_msm8998/drivers/target
Jiang Yi 8d83251372 target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce
commit 1d6ef276594a781686058802996e09c8550fd767 upstream.

This patch addresses a COMPARE_AND_WRITE se_device->caw_sem leak,
that would be triggered during normal se_cmd shutdown or abort
via __transport_wait_for_tasks().

This would occur because target_complete_cmd() would catch this
early and do complete_all(&cmd->t_transport_stop_comp), but since
target_complete_ok_work() or target_complete_failure_work() are
never called to invoke se_cmd->transport_complete_callback(),
the COMPARE_AND_WRITE specific callbacks never release caw_sem.

To address this special case, go ahead and release caw_sem
directly from target_complete_cmd().

(Remove '&& success' from check, to release caw_sem regardless
 of scsi_status - nab)

Signed-off-by: Jiang Yi <jiangyilism@gmail.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-27 15:06:09 -07:00
..
iscsi iscsi-target: Add login_keys_workaround attribute for non RFC initiators 2017-07-27 15:06:04 -07:00
loopback
sbp
tcm_fc
Kconfig
Makefile
target_core_alua.c
target_core_alua.h
target_core_configfs.c
target_core_device.c target: Fix NULL dereference during LUN lookup + active I/O shutdown 2017-03-15 09:57:14 +08:00
target_core_fabric_configfs.c
target_core_fabric_lib.c
target_core_file.c target/fileio: Fix zero-length READ and WRITE handling 2017-05-20 14:26:58 +02:00
target_core_file.h
target_core_hba.c
target_core_iblock.c target: Fix max_unmap_lba_count calc overflow 2016-08-20 18:09:26 +02:00
target_core_iblock.h
target_core_internal.h target: Fix kref->refcount underflow in transport_cmd_finish_abort 2017-06-29 12:48:51 +02:00
target_core_pr.c
target_core_pr.h
target_core_pscsi.c target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export 2017-03-26 12:13:19 +02:00
target_core_pscsi.h
target_core_rd.c
target_core_rd.h
target_core_sbc.c target: Fix compare_and_write_callback handling for non GOOD status 2017-05-20 14:26:58 +02:00
target_core_spc.c
target_core_stat.c
target_core_tmr.c target: Fix kref->refcount underflow in transport_cmd_finish_abort 2017-06-29 12:48:51 +02:00
target_core_tpg.c target: Convert ACL change queue_depth se_session reference usage 2017-05-20 14:26:58 +02:00
target_core_transport.c target: Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce 2017-07-27 15:06:09 -07:00
target_core_ua.c
target_core_ua.h
target_core_user.c target/user: Fix use-after-free of tcmu_cmds if they are expired 2017-01-09 08:07:53 +01:00
target_core_xcopy.c target: Use correct SCSI status during EXTENDED_COPY exception 2017-02-14 15:22:51 -08:00
target_core_xcopy.h