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