public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* how to do fc_remote_port_delete correctly
@ 2009-06-24  0:27 Joe Eykholt
       [not found] ` <4A4172FA.70008-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: Joe Eykholt @ 2009-06-24  0:27 UTC (permalink / raw)
  To: devel@open-fcoe.org, linux-scsi

This seems pretty basic, but I'm having trouble with it.

The current libfc code has a private structure called fc_rport_libfc_priv
that gets allocated along with the fc_rport structure.

I'm working on patches that restructure this to be separately allocated,
since we need a the private structure to be around before we can do
fc_remote_port_add().  It's a long story, but my question applies to
any FC driver that wants to allocate its rport private data separately.

How should rport->dd_data be set to NULL before/after calling
fc_rport_delete().

I used to set it to NULL before, but figure it's safer to clear it after
terminate_io has been called.  I did a get_device(&rport->dev) first
to be sure the rport doesn't get freed in the meantime.

However, other threads may be in queuecommand already and already
beyond their call to fc_remote_port_chkready() and will reference dd_data.
Maybe they just aren't allowed do that?

Or maybe dd_data isn't allowed to go NULL until the rport times
out and is getting deleted?

Maybe we need a small private rport data with just enough info for the I/O
that's already in progress, or I can recode the I/O path to not use
dd_data (it's mostly stuff that can be gotten through scsi_host instead).

Or maybe we need to do more in our fc_rport_terminate_io callback
from fc_remote_port_delete() to be sure that all I/O really ceases.
We currently do an exch_mgr_reset(), but perhaps some I/O thread hasn't
allocated an exchange yet.

Ideas?

	Thanks,
	Joe




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

end of thread, other threads:[~2009-06-24 19:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-24  0:27 how to do fc_remote_port_delete correctly Joe Eykholt
     [not found] ` <4A4172FA.70008-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-06-24 14:40   ` James Smart
     [not found]     ` <4A423ADE.80306-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2009-06-24 16:29       ` James Smart
2009-06-24 16:30       ` James Smart
     [not found]         ` <4A4254BC.6090302-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2009-06-24 17:47           ` Joe Eykholt
     [not found]             ` <4A426698.3-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-06-24 18:31               ` James Smart
     [not found]                 ` <4A427107.6060303-laKkSmNT4hbQT0dZR+AlfA@public.gmane.org>
2009-06-24 19:33                   ` Joe Eykholt
2009-06-24 17:10       ` Joe Eykholt
     [not found]         ` <4A425DF1.30005-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-06-24 17:43           ` James Smart
2009-06-24 17:45         ` [Open-FCoE] " James Smart

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