diff mbox series

scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case.

Message ID 1600300471-26135-1-git-send-email-sudhakar.panneerselvam@oracle.com (mailing list archive)
State Accepted
Commit 149415586243bd0ea729760fb6dd7b3c50601871
Headers show
Series scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case. | expand

Commit Message

Sudhakar Panneerselvam Sept. 16, 2020, 11:54 p.m. UTC
transport_lookup_tmr_lun() uses "orig_fe_lun" member of struct se_cmd
for the lookup. Hence, update this field directly for the
TARGET_SCF_LOOKUP_LUN_FROM_TAG case.

Fixes: a36840d80027 ("target: Initialize LUN in transport_init_se_cmd()")
Reported-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
---
 drivers/target/target_core_transport.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mike Christie Sept. 22, 2020, 5:28 p.m. UTC | #1
On 9/16/20 6:54 PM, Sudhakar Panneerselvam wrote:
> transport_lookup_tmr_lun() uses "orig_fe_lun" member of struct se_cmd
> for the lookup. Hence, update this field directly for the
> TARGET_SCF_LOOKUP_LUN_FROM_TAG case.
> 
> Fixes: a36840d80027 ("target: Initialize LUN in transport_init_se_cmd()")
> Reported-by: Martin Wilck <mwilck@suse.com>
> Signed-off-by: Sudhakar Panneerselvam <sudhakar.panneerselvam@oracle.com>
> ---
>  drivers/target/target_core_transport.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
> index 9fb0be0aa620..8dd289214dd8 100644
> --- a/drivers/target/target_core_transport.c
> +++ b/drivers/target/target_core_transport.c
> @@ -1840,7 +1840,8 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
>  	 * out unpacked_lun for the original se_cmd.
>  	 */
>  	if (tm_type == TMR_ABORT_TASK && (flags & TARGET_SCF_LOOKUP_LUN_FROM_TAG)) {
> -		if (!target_lookup_lun_from_tag(se_sess, tag, &unpacked_lun))
> +		if (!target_lookup_lun_from_tag(se_sess, tag,
> +						&se_cmd->orig_fe_lun))
>  			goto failure;
>  	}
>  
> 

Reviewed-by: Mike Christie <michael.christie@oracle.com>
Martin K. Petersen Sept. 23, 2020, 12:51 a.m. UTC | #2
On Wed, 16 Sep 2020 23:54:31 +0000, Sudhakar Panneerselvam wrote:

> transport_lookup_tmr_lun() uses "orig_fe_lun" member of struct se_cmd
> for the lookup. Hence, update this field directly for the
> TARGET_SCF_LOOKUP_LUN_FROM_TAG case.

Applied to 5.9/scsi-fixes, thanks!

[1/1] scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case
      https://git.kernel.org/mkp/scsi/c/149415586243
Martin K. Petersen Sept. 30, 2020, 3:33 a.m. UTC | #3
On Wed, 16 Sep 2020 23:54:31 +0000, Sudhakar Panneerselvam wrote:

> transport_lookup_tmr_lun() uses "orig_fe_lun" member of struct se_cmd
> for the lookup. Hence, update this field directly for the
> TARGET_SCF_LOOKUP_LUN_FROM_TAG case.

Applied to 5.9/scsi-fixes, thanks!

[1/1] scsi: target: Fix lun lookup for TARGET_SCF_LOOKUP_LUN_FROM_TAG case
      https://git.kernel.org/mkp/scsi/c/149415586243
diff mbox series

Patch

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 9fb0be0aa620..8dd289214dd8 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1840,7 +1840,8 @@  int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 	 * out unpacked_lun for the original se_cmd.
 	 */
 	if (tm_type == TMR_ABORT_TASK && (flags & TARGET_SCF_LOOKUP_LUN_FROM_TAG)) {
-		if (!target_lookup_lun_from_tag(se_sess, tag, &unpacked_lun))
+		if (!target_lookup_lun_from_tag(se_sess, tag,
+						&se_cmd->orig_fe_lun))
 			goto failure;
 	}