All of lore.kernel.org
 help / color / mirror / Atom feed
* Two more ib_srp patches
@ 2012-08-17  9:50 Bart Van Assche
       [not found] ` <502E13DA.2030603-HInyCGIudOg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2012-08-17  9:50 UTC (permalink / raw)
  To: David Dillow, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

Hello Dave,

I think I have found two additional (longstanding) ib_srp issues. Do the
patches below make sense to you ? If so, do you prefer that I post these
as individual patches or that I merge these in the patch called "[PATCH
01/20] ib_srp: Fix a race condition" ?

Thanks,

Bart.

[PATCH 1/2] ib_srp: Fix use-after-free in srp_reset_req()

---
 drivers/infiniband/ulp/srp/ib_srp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
b/drivers/infiniband/ulp/srp/ib_srp.c
index f5e2180..42b7ef6 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -806,9 +806,9 @@ static void srp_reset_req(struct srp_target_port
*target, struct srp_request *re
 	struct scsi_cmnd *scmnd = srp_claim_req(target, req, NULL);

 	if (scmnd) {
+		srp_free_req(target, req, scmnd, 0);
 		scmnd->result = DID_RESET << 16;
 		scmnd->scsi_done(scmnd);
-		srp_free_req(target, req, scmnd, 0);
 	}
 }



[PATCH 2/2] ib_srp: Avoid that aborted requests cause I/O to hang

---
 drivers/infiniband/ulp/srp/ib_srp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c
b/drivers/infiniband/ulp/srp/ib_srp.c
index 42b7ef6..7ae5a00 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1927,6 +1927,7 @@ static int srp_abort(struct scsi_cmnd *scmnd)
 			  SRP_TSK_ABORT_TASK);
 	srp_free_req(target, req, scmnd, 0);
 	scmnd->result = DID_ABORT << 16;
+	scmnd->scsi_done(scmnd);

 	return SUCCESS;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-17 16:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-17  9:50 Two more ib_srp patches Bart Van Assche
     [not found] ` <502E13DA.2030603-HInyCGIudOg@public.gmane.org>
2012-08-17 15:07   ` David Dillow
     [not found]     ` <1345216056.17811.7.camel-zHLflQxYYDO4Hhoo1DtQwJ9G+ZOsUmrO@public.gmane.org>
2012-08-17 16:49       ` Roland Dreier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.