Skip to content

Commit 92a5655

Browse files
David Jefferytrondmypd
authored andcommitted
nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait, it will busy-wait or soft lockup in its while loop. nfs_wait_bit_killable won't sleep, and the loop won't exit on the error return. Stop the busy-wait by breaking out of the loop when nfs_wait_bit_killable returns an error. Signed-off-by: David Jeffery <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 78270e8 commit 92a5655

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/pagelist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
116116
if (atomic_read(&c->io_count) == 0)
117117
break;
118118
ret = nfs_wait_bit_killable(&q.key);
119-
} while (atomic_read(&c->io_count) != 0);
119+
} while (atomic_read(&c->io_count) != 0 && !ret);
120120
finish_wait(wq, &q.wait);
121121
return ret;
122122
}

0 commit comments

Comments
 (0)