diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-10-14 18:26:34 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-10-25 22:03:12 -0400 |
commit | b7c8921bf1a8a9c1907b1eeb029d3f167be226f3 (patch) | |
tree | 8b3fcc1f10d297ddde054f8be887cd09129e0320 /net/core | |
parent | 670c02c2bfd2c8a305a90f5285409a7b0a8fd630 (diff) |
[PKTGEN]: Sleeping function called under lock
pktgen is calling kmalloc GFP_KERNEL and vmalloc with lock held.
The simplest fix is to turn the lock into a semaphore, since the
thread lock is only used for admin control from user context.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/pktgen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 00116d8b3b28..8a90bf79261a 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
@@ -177,8 +177,8 @@ | |||
177 | #define T_REMDEV (1<<3) /* Remove all devs */ | 177 | #define T_REMDEV (1<<3) /* Remove all devs */ |
178 | 178 | ||
179 | /* Locks */ | 179 | /* Locks */ |
180 | #define thread_lock() spin_lock(&_thread_lock) | 180 | #define thread_lock() down(&pktgen_sem) |
181 | #define thread_unlock() spin_unlock(&_thread_lock) | 181 | #define thread_unlock() up(&pktgen_sem) |
182 | 182 | ||
183 | /* If lock -- can be removed after some work */ | 183 | /* If lock -- can be removed after some work */ |
184 | #define if_lock(t) spin_lock(&(t->if_lock)); | 184 | #define if_lock(t) spin_lock(&(t->if_lock)); |
@@ -503,7 +503,7 @@ static int pg_delay_d = 0; | |||
503 | static int pg_clone_skb_d = 0; | 503 | static int pg_clone_skb_d = 0; |
504 | static int debug = 0; | 504 | static int debug = 0; |
505 | 505 | ||
506 | static DEFINE_SPINLOCK(_thread_lock); | 506 | static DECLARE_MUTEX(pktgen_sem); |
507 | static struct pktgen_thread *pktgen_threads = NULL; | 507 | static struct pktgen_thread *pktgen_threads = NULL; |
508 | 508 | ||
509 | static char module_fname[128]; | 509 | static char module_fname[128]; |