mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 00:22:00 +02:00
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: Zhen Ni <zhen.ni@easystack.cn> Message-Id: <20230517085412.367022-1-zhen.ni@easystack.cn> Signed-off-by: Corey Minyard <minyard@acm.org>
This commit is contained in:
parent
4d6d4c7f54
commit
9930702cfe
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user