From: David Jeffery Date: Tue, 5 Aug 2014 15:19:42 +0000 (-0400) Subject: nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait X-Git-Tag: MMI-PSA29.97-13-9~11644^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=92a56555bd576c61b27a5cab9f38a33a1e9a1df5;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 932c6cc27a76..be7cbce6e4c7 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c) if (atomic_read(&c->io_count) == 0) break; ret = nfs_wait_bit_killable(&q.key); - } while (atomic_read(&c->io_count) != 0); + } while (atomic_read(&c->io_count) != 0 && !ret); finish_wait(wq, &q.wait); return ret; }