diff mbox series

RDMA/srp: Fix srp_abort()

Message ID 20220908233139.3042628-1-bvanassche@acm.org (mailing list archive)
State Accepted
Headers show
Series RDMA/srp: Fix srp_abort() | expand

Commit Message

Bart Van Assche Sept. 8, 2022, 11:31 p.m. UTC
Fix the code for converting a SCSI command pointer into an SRP request
pointer.

Cc: Xiao Yang <yangx.jy@fujitsu.com>
Fixes: ad215aaea4f9 ("RDMA/srp: Make struct scsi_cmnd and struct srp_request adjacent")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Leon Romanovsky Sept. 20, 2022, 11:16 a.m. UTC | #1
On Thu, 8 Sep 2022 16:31:39 -0700, Bart Van Assche wrote:
> Fix the code for converting a SCSI command pointer into an SRP request
> pointer.
> 
> 

Applied, thanks!

[1/1] RDMA/srp: Fix srp_abort()
      commit: 6dbe4a8dead84de474483910b02ec9e6a10fc1a9

Best regards,
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 7720ea270ed8..b2e2f3d0b998 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2788,7 +2788,7 @@  static int srp_send_tsk_mgmt(struct srp_rdma_ch *ch, u64 req_tag, u64 lun,
 static int srp_abort(struct scsi_cmnd *scmnd)
 {
 	struct srp_target_port *target = host_to_target(scmnd->device->host);
-	struct srp_request *req = (struct srp_request *) scmnd->host_scribble;
+	struct srp_request *req = scsi_cmd_priv(scmnd);
 	u32 tag;
 	u16 ch_idx;
 	struct srp_rdma_ch *ch;
@@ -2796,8 +2796,6 @@  static int srp_abort(struct scsi_cmnd *scmnd)
 
 	shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n");
 
-	if (!req)
-		return SUCCESS;
 	tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmnd));
 	ch_idx = blk_mq_unique_tag_to_hwq(tag);
 	if (WARN_ON_ONCE(ch_idx >= target->ch_count))