On 08/29/05 05:14, 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.

In your "strategy" routine:

        ...
        spin_lock_irqsave(shost->host_lock, flags);
        list_splice_init(&shost->eh_cmd_q, &error_q);
        spin_unlock_irqrestore(shost->host_lock, flags);
        ...

        loop {
                ...
                list_del_init(&cmd->eh_entry);
                ...
        }

A good policy to follow is:
        1. Never leave prev/next pointing somewhere where
                - you don't belong, or
                - where you don't know existance is in place.
        2. Someone (memory release?) may do:
                if (!list_empty(cmd->eh_entry))
                        Refuse to free the memory.
        Which is often the case to check if the object belongs to
        a list. (You shouldn't have to do this but case pointed only for
        illustrational purposes.)

   Luben

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to