Re: [PATCH] target: Fix incorrect se_cmd assignment in core_tmr_drain_tmr_list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 25, 2011 at 10:21 PM, Nicholas A. Bellinger
<nab@xxxxxxxxxxxxxxx> wrote:
> diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
> index e617527..b2e8f45 100644
> --- a/drivers/target/target_core_tmr.c
> +++ b/drivers/target/target_core_tmr.c
> @@ -154,7 +154,7 @@ static void core_tmr_drain_tmr_list(
>        while (!list_empty(&drain_tmr_list)) {
>                tmr = list_entry(drain_tmr_list.next, struct se_tmr_req, tmr_list);
>                list_del(&tmr->tmr_list);
> -               cmd = tmr_p->task_cmd;
> +               cmd = tmr->task_cmd;
>
>                pr_debug("LUN_RESET: %s releasing TMR %p Function: 0x%02x,"
>                        " Response: 0x%02x, t_state: %d\n",

Actually it might be cleaner to set tmr_p to the first entry, rather than
overwriting tmr (which is a parameter to the function).

Also, a trivial cleanup would be to use list_first_entry(&drain_tmr_list,...).

In fact is there any reason why this loop needs to be a while() instead of
list_for_each_entry_safe()?

Finally, earlier in the function:

                if (cmd->t_state == TRANSPORT_ISTATE_PROCESSING) {
                        spin_unlock(&cmd->t_state_lock);
                        continue;
                }
                spin_unlock(&cmd->t_state_lock);

                list_move_tail(&tmr->tmr_list, &drain_tmr_list);
        }
        spin_unlock_irqrestore(&dev->se_tmr_lock, flags);

looks like that tmr in list_move_tail should be tmr_p too?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux