Commit 9930702c authored by Corey Minyard's avatar Corey Minyard

ipmi_watchdog: Fix read syscall not responding to signals during sleep

Read syscall cannot response to sigals when data_to_read remains at 0
and the while loop cannot break.  Check signal_pending in the loop.
Reported-by: default avatarZhen Ni <zhen.ni@easystack.cn>
Message-Id: <20230517085412.367022-1-zhen.ni@easystack.cn>
Signed-off-by: default avatarCorey Minyard <minyard@acm.org>
parent 4d6d4c7f
......@@ -802,7 +802,7 @@ static ssize_t ipmi_read(struct file *file,
init_waitqueue_entry(&wait, current);
add_wait_queue(&read_q, &wait);
while (!data_to_read) {
while (!data_to_read && !signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irq(&ipmi_read_lock);
schedule();
......
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