Commit aa0d8c97 authored by Krishna Kumar's avatar Krishna Kumar Committed by David S. Miller

[XFRM]: In xfrm_lookup(), schedule() before retrying template resolution.

parent 83b79378
......@@ -775,20 +775,17 @@ int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
if (unlikely(nx<0)) {
err = nx;
if (err == -EAGAIN) {
struct task_struct *tsk = current;
DECLARE_WAITQUEUE(wait, tsk);
if (!flags)
goto error;
if (err == -EAGAIN && !flags) {
DECLARE_WAITQUEUE(wait, current);
__set_task_state(tsk, TASK_INTERRUPTIBLE);
add_wait_queue(&km_waitq, &wait);
nx = xfrm_tmpl_resolve(policy, fl, xfrm, family);
if (nx == -EAGAIN)
schedule();
__set_task_state(tsk, TASK_RUNNING);
set_current_state(TASK_INTERRUPTIBLE);
schedule();
set_current_state(TASK_RUNNING);
remove_wait_queue(&km_waitq, &wait);
nx = xfrm_tmpl_resolve(policy, fl, xfrm, family);
if (nx == -EAGAIN && signal_pending(current)) {
err = -ERESTART;
goto error;
......
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