Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1dd0a067 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Nicholas Bellinger
Browse files

target: use save/restore lock primitive in core_dec_lacl_count()



It may happen that uasp will free the request in irq conntext, the
callchain:

 uasp_cmd_release() -> transport_generic_free_cmd() -> core_dec_lacl_count()

where the last function enables the IRQ. Those irqs are re-disabled
later (due to the spin.*irq_restore) but in between we could get hurt.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent e59a41b6
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -320,11 +320,12 @@ int core_free_device_list_for_node(
void core_dec_lacl_count(struct se_node_acl *se_nacl, struct se_cmd *se_cmd)
void core_dec_lacl_count(struct se_node_acl *se_nacl, struct se_cmd *se_cmd)
{
{
	struct se_dev_entry *deve;
	struct se_dev_entry *deve;
	unsigned long flags;


	spin_lock_irq(&se_nacl->device_list_lock);
	spin_lock_irqsave(&se_nacl->device_list_lock, flags);
	deve = &se_nacl->device_list[se_cmd->orig_fe_lun];
	deve = &se_nacl->device_list[se_cmd->orig_fe_lun];
	deve->deve_cmds--;
	deve->deve_cmds--;
	spin_unlock_irq(&se_nacl->device_list_lock);
	spin_unlock_irqrestore(&se_nacl->device_list_lock, flags);
}
}


void core_update_device_list_access(
void core_update_device_list_access(