Commit 3ee7ecd7 authored by Jack Wang's avatar Jack Wang Committed by Leon Romanovsky

RDMA/rtrs-srv: Do not unconditionally enable irq

When IO is completed, rtrs can be called in softirq context,
unconditionally enabling irq could cause panic.

To be on safe side, use spin_lock_irqsave and spin_unlock_irqrestore
instread.

Fixes: 9cb83748 ("RDMA/rtrs: server: main functionality")
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarFlorian-Ewald Mueller <florian-ewald.mueller@ionos.com>
Signed-off-by: default avatarMd Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: default avatarGrzegorz Prajsner <grzegorz.prajsner@ionos.com>
Link: https://lore.kernel.org/r/20231120154146.920486-2-haris.iqbal@ionos.comSigned-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent b6f09b16
......@@ -65,8 +65,9 @@ static bool rtrs_srv_change_state(struct rtrs_srv_path *srv_path,
{
enum rtrs_srv_state old_state;
bool changed = false;
unsigned long flags;
spin_lock_irq(&srv_path->state_lock);
spin_lock_irqsave(&srv_path->state_lock, flags);
old_state = srv_path->state;
switch (new_state) {
case RTRS_SRV_CONNECTED:
......@@ -87,7 +88,7 @@ static bool rtrs_srv_change_state(struct rtrs_srv_path *srv_path,
}
if (changed)
srv_path->state = new_state;
spin_unlock_irq(&srv_path->state_lock);
spin_unlock_irqrestore(&srv_path->state_lock, flags);
return changed;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment