Re: [PATCH] target: Make transport_lookup_cmd_lun() locking IRQ-safe

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

 



On Tue, 2011-06-14 at 04:12 -0400, Christoph Hellwig wrote:
> On Mon, Jun 13, 2011 at 08:44:05PM -0700, Roland Dreier wrote:
> > From: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> > 
> > transport_lookup_cmd_lun() may be called from interrupt context (eg
> > tcm_loop_allocate_core_cmd() calls it, and it has a comment that says,
> > "Can be called from interrupt context"), so it needs to use
> > spin_lock_irqsave() instead of spin_lock_irq() to avoid enabling
> > interrupts at the wrong time.
> > 
> > (And indeed the last set of lock operations, on lun_cmd_lock, were
> > already using spin_lock_irqsave(), so we just need to fix the other
> > two locks we take)
> 
> It currently is, but I think we'd better be off stopping to call it from
> IRQ context.  Soon after we offload the work to thread context anyway.
> By moving the point of offloading a little earlier we can simply the
> calling conventions a lot, and keep the amount of code that needs
> IRQ-safe locking minimal.
> 

The thing here is that the new descriptor can't be offloaded into thread
context for TFO->new_cmd_map() processing until the se_cmd->se_dev
assignment has occured, because we don't know which backend it's
destined for.

So, I think we at least need this patch..

--nab


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux