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

* Re: Two more ib_srp patches
       [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>
  0 siblings, 1 reply; 3+ messages in thread
From: David Dillow @ 2012-08-17 15:07 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Fri, 2012-08-17 at 05:50 -0400, Bart Van Assche wrote:
> 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" ?

Separate patches are fine.

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

This needs to have a commit message along the lines of
"srp_free_req() uses the scsi_cmnd structure to unmap buffers, so we
must do that before we call release ownership by calling scsi_done()."

But otherwise

Acked-by: David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>

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

Acked-by: David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org>


-- 
Dave Dillow
National Center for Computational Science
Oak Ridge National Laboratory
(865) 241-6602 office


--
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	[flat|nested] 3+ messages in thread

* Re: Two more ib_srp patches
       [not found]     ` <1345216056.17811.7.camel-zHLflQxYYDO4Hhoo1DtQwJ9G+ZOsUmrO@public.gmane.org>
@ 2012-08-17 16:49       ` Roland Dreier
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2012-08-17 16:49 UTC (permalink / raw)
  To: David Dillow
  Cc: Bart Van Assche,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Fri, Aug 17, 2012 at 8:07 AM, David Dillow <dillowda-1Heg1YXhbW8@public.gmane.org> wrote:
> On Fri, 2012-08-17 at 05:50 -0400, Bart Van Assche wrote:
>> 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" ?
>
> Separate patches are fine.

Yes, please send new separate patches, I already merged the race fix and
I'm planning on sending a pull request to Linus shortly.

[ugh, reply-to-all this time, sorry for the dupe Dave]
--
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	[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.