Skip to content

Commit dd269db

Browse files
sm00thklassert
authored andcommitted
xfrm: don't call xfrm_policy_cache_flush under xfrm_state_lock
I might be wrong but it doesn't look like xfrm_state_lock is required for xfrm_policy_cache_flush and calling it under this lock triggers both "sleeping function called from invalid context" and "possible circular locking dependency detected" warnings on flush. Fixes: ec30d78 xfrm: add xdst pcpu cache Signed-off-by: Artem Savkov <asavkov@redhat.com> Acked-by: Florian Westphal <fw@strlen.de> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent 23e9fcf commit dd269db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/xfrm/xfrm_state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,12 +732,12 @@ int xfrm_state_flush(struct net *net, u8 proto, bool task_valid)
732732
}
733733
}
734734
}
735+
out:
736+
spin_unlock_bh(&net->xfrm.xfrm_state_lock);
735737
if (cnt) {
736738
err = 0;
737739
xfrm_policy_cache_flush();
738740
}
739-
out:
740-
spin_unlock_bh(&net->xfrm.xfrm_state_lock);
741741
return err;
742742
}
743743
EXPORT_SYMBOL(xfrm_state_flush);

0 commit comments

Comments
 (0)