public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iscsi: avoid oops when destroying unbound connection
@ 2006-10-30  1:29 Pete Wyckoff
  2006-10-30 18:02 ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: Pete Wyckoff @ 2006-10-30  1:29 UTC (permalink / raw)
  To: linux-scsi

Initialize the conn->item list head in a connection, used for
associating it with a session, to avoid an oops if list_del happens
before the connection is bound.  The oops is easy enough to
reproduce by calling CREATE_SESSION, CREATE_CONN, then DESTROY_CONN
(but no BIND_CONN) from userspace.

Signed-off-by: Pete Wyckoff <pw@osc.edu>
---
 drivers/scsi/libiscsi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index c542d0e..66fc239 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1477,6 +1477,7 @@ iscsi_conn_setup(struct iscsi_cls_sessio
 	INIT_LIST_HEAD(&conn->run_list);
 	INIT_LIST_HEAD(&conn->mgmt_run_list);
 	INIT_LIST_HEAD(&conn->xmitqueue);
+	INIT_LIST_HEAD(&conn->item);
 
 	/* initialize general immediate & non-immediate PDU commands queue */
 	conn->immqueue = kfifo_alloc(session->mgmtpool_max * sizeof(void*),

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

* Re: [PATCH] iscsi: avoid oops when destroying unbound connection
  2006-10-30  1:29 [PATCH] iscsi: avoid oops when destroying unbound connection Pete Wyckoff
@ 2006-10-30 18:02 ` Mike Christie
  2006-10-30 19:17   ` Pete Wyckoff
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Christie @ 2006-10-30 18:02 UTC (permalink / raw)
  To: Pete Wyckoff; +Cc: linux-scsi

Pete Wyckoff wrote:
> Initialize the conn->item list head in a connection, used for
> associating it with a session, to avoid an oops if list_del happens
> before the connection is bound.  The oops is easy enough to
> reproduce by calling CREATE_SESSION, CREATE_CONN, then DESTROY_CONN
> (but no BIND_CONN) from userspace.
> 
> Signed-off-by: Pete Wyckoff <pw@osc.edu>
> ---
>  drivers/scsi/libiscsi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index c542d0e..66fc239 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -1477,6 +1477,7 @@ iscsi_conn_setup(struct iscsi_cls_sessio
>  	INIT_LIST_HEAD(&conn->run_list);
>  	INIT_LIST_HEAD(&conn->mgmt_run_list);
>  	INIT_LIST_HEAD(&conn->xmitqueue);
> +	INIT_LIST_HEAD(&conn->item);
>  
>  	/* initialize general immediate & non-immediate PDU commands queue */
>  	conn->immqueue = kfifo_alloc(session->mgmtpool_max * sizeof(void*),


Thanks for the patch. We actually already fixed this by just removing
that list. It was not being used for what it was originally intended and
was getting in the way.

The fix should be in 2.6.19-rc4 when it comes out.

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

* Re: [PATCH] iscsi: avoid oops when destroying unbound connection
  2006-10-30 18:02 ` Mike Christie
@ 2006-10-30 19:17   ` Pete Wyckoff
  2006-10-30 19:30     ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: Pete Wyckoff @ 2006-10-30 19:17 UTC (permalink / raw)
  To: Mike Christie; +Cc: linux-scsi

michaelc@cs.wisc.edu wrote on Mon, 30 Oct 2006 12:02 -0600:
> Thanks for the patch. We actually already fixed this by just removing
> that list. It was not being used for what it was originally intended and
> was getting in the way.
> 
> The fix should be in 2.6.19-rc4 when it comes out.

That's even better.  For future reference, where is the SCSI or
iSCSI development tree?  I had guessed it might be jejb's
scsi-misc-2.6 git, but that still has conn->item, as does your
linux-2.6-iscsi git.  If I can check for fixes before sending off a
patch, it will save us all some time.

		-- Pete

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

* Re: [PATCH] iscsi: avoid oops when destroying unbound connection
  2006-10-30 19:17   ` Pete Wyckoff
@ 2006-10-30 19:30     ` Mike Christie
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2006-10-30 19:30 UTC (permalink / raw)
  To: Pete Wyckoff; +Cc: linux-scsi

Pete Wyckoff wrote:
> michaelc@cs.wisc.edu wrote on Mon, 30 Oct 2006 12:02 -0600:
>> Thanks for the patch. We actually already fixed this by just removing
>> that list. It was not being used for what it was originally intended and
>> was getting in the way.
>>
>> The fix should be in 2.6.19-rc4 when it comes out.
> 
> That's even better.  For future reference, where is the SCSI or
> iSCSI development tree?  I had guessed it might be jejb's
> scsi-misc-2.6 git, but that still has conn->item, as does your
> linux-2.6-iscsi git.  If I can check for fixes before sending off a

You have to checkout the iscsi branch (git checkout iscsi) after you
have downloaded the linux-2.6-iscsi.git tree.

> patch, it will save us all some time.
> 

James switches from scsi-misc to scsi-rc fixes depending on the timing
(rc4 vs not even rc1) and patch type (fix vs feature). This patch was
put in scsi-rc-fixes here

http://kernel.org/git/?p=linux/kernel/git/jejb/scsi-rc-fixes-2.6.git;a=commit;h=98644047916c24258fb47c3dab2bed8a44f53b83

and sent to upwards with his last patchset.

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

end of thread, other threads:[~2006-10-30 19:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-30  1:29 [PATCH] iscsi: avoid oops when destroying unbound connection Pete Wyckoff
2006-10-30 18:02 ` Mike Christie
2006-10-30 19:17   ` Pete Wyckoff
2006-10-30 19:30     ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox