Skip to content

Commit ed1c964

Browse files
Dave Joneshallyn
authored andcommitted
selinux: conditionally reschedule in hashtab_insert while loading selinux policy
After silencing the sleeping warning in mls_convert_context() I started seeing similar traces from hashtab_insert. Do a cond_resched there too. Signed-off-by: Dave Jones <davej@redhat.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Paul Moore <pmoore@redhat.com>
1 parent 9a591f3 commit ed1c964

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎security/selinux/ss/hashtab.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <linux/kernel.h>
77
#include <linux/slab.h>
88
#include <linux/errno.h>
9+
#include <linux/sched.h>
910
#include "hashtab.h"
1011

1112
struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
@@ -40,6 +41,8 @@ int hashtab_insert(struct hashtab *h, void *key, void *datum)
4041
u32 hvalue;
4142
struct hashtab_node *prev, *cur, *newnode;
4243

44+
cond_resched();
45+
4346
if (!h || h->nel == HASHTAB_MAX_NODES)
4447
return -EINVAL;
4548

0 commit comments

Comments
 (0)