All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Tejun Heo <htejun@gmail.com>
Cc: James.Bottomley@steeleye.com, luben_tuikov@adaptec.com,
	albertcc@tw.ibm.com, linux-scsi@vger.kernel.org
Subject: Re: [RFC] SCSI EH document
Date: Mon, 29 Aug 2005 18:27:25 -0400	[thread overview]
Message-ID: <43138BCD.7060106@pobox.com> (raw)
In-Reply-To: <4313803B.3060703@gmail.com>

Tejun Heo wrote:
> 
>  Hi, Jeff.
> 
> Jeff Garzik wrote:
> 
>> Tejun Heo wrote:
>>
>>>> Both all the list-heads need to be cleared, otherwise there may be 
>>>> list corruption next time the element is added to the list_head.
>>>>
>>>
>>>  scmd->eh_entry is never used as list head.  It's always used as list 
>>> entry.  So, technically, it needs not be cleared, I think.  No?  The 
>>> problem we had was w/ shost->eh_cmd_q not being cleared.
>>
>>
>>
>> Every node is a list_head.  You want all pointers for all nodes 
>> pointing to something useful, even if they are not actively present on 
>> a list, so that they may be easily and corrected added to a list at a 
>> later time. Read list_del_init() for example.
>>
>>     Jeff
>>
> 
>  Okay... to make things clearer.  A struct list_head can have two roles.
> 
>  list head  : other list_head gets added to it
>  list entry : gets added to other list_head
> 
>  When a struct list_head acts as list head, it always needs to be in 
> clean (pointing to valid things) state before being used.  When a struct 
> list_head acts as list entry, its current content doesn't matter.
> 
>  AFAICS, scmd->eh_entry is currently not used as list head in any place, 
> neither do we use list_empty() test on it to determine whether or not 
> it's on a list.  The original code does clear scmd->eh_entry all the 
> time and I am very okay with that.  I just wanted to make sure that I 
> didn't miss something regarding scmd->eh_entry's usage.
> 
>  If I'm missing such a usage, can you please point out?


I'm mainly talking at a higher level.  While it strictly doesn't matter 
in this instance, in general its a bad idea to clear a list using a

	list = (null)

operation.  Its a good way to leak references, leak memory, etc.

In this specific case it seems to be OK.

	Jeff



  reply	other threads:[~2005-08-29 22:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-26  3:53 [RFC] SCSI EH document Tejun Heo
2005-08-26 21:34 ` Jeff Garzik
2005-08-29  9:14   ` Tejun Heo
2005-08-29 13:55     ` Luben Tuikov
2005-08-30 10:47       ` Tejun Heo
2005-08-30 14:50         ` Luben Tuikov
2005-08-29 18:50     ` Jeff Garzik
2005-08-29 19:49       ` Matthew Wilcox
2005-08-29 19:49         ` Jeff Garzik
2005-08-29 21:38       ` Tejun Heo
2005-08-29 22:27         ` Jeff Garzik [this message]
2005-08-26 21:36 ` Luben Tuikov
2005-09-07  8:04 ` Jeff Garzik
2005-09-07 11:22   ` Tejun Heo
2005-09-07 13:12     ` Luben Tuikov
2005-09-07 14:00     ` James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43138BCD.7060106@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=albertcc@tw.ibm.com \
    --cc=htejun@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=luben_tuikov@adaptec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.