Commit e312624f authored by David Jeffery's avatar David Jeffery Committed by Luis Henriques

nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait

commit 92a56555 upstream.

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: default avatarDavid Jeffery <djeffery@redhat.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
[ kamal: backport to 3.13-stable: context ]
Cc: Moritz Mühlenhoff <muehlenhoff@univention.de>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 9ff7521d
...@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c) ...@@ -116,7 +116,7 @@ __nfs_iocounter_wait(struct nfs_io_counter *c)
if (atomic_read(&c->io_count) == 0) if (atomic_read(&c->io_count) == 0)
break; break;
ret = nfs_wait_bit_killable(&c->flags); ret = nfs_wait_bit_killable(&c->flags);
} while (atomic_read(&c->io_count) != 0); } while (atomic_read(&c->io_count) != 0 && !ret);
finish_wait(wq, &q.wait); finish_wait(wq, &q.wait);
return ret; return ret;
} }
......
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