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>
This commit is contained in:
parent
9a591f39a9
commit
ed1c96429a
@ -6,6 +6,7 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
#include "hashtab.h"
|
#include "hashtab.h"
|
||||||
|
|
||||||
struct hashtab *hashtab_create(u32 (*hash_value)(struct hashtab *h, const void *key),
|
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)
|
|||||||
u32 hvalue;
|
u32 hvalue;
|
||||||
struct hashtab_node *prev, *cur, *newnode;
|
struct hashtab_node *prev, *cur, *newnode;
|
||||||
|
|
||||||
|
cond_resched();
|
||||||
|
|
||||||
if (!h || h->nel == HASHTAB_MAX_NODES)
|
if (!h || h->nel == HASHTAB_MAX_NODES)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user