b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL
@ 2010-05-19 19:00 Sven Eckelmann
  2010-05-19 19:12 ` [B.A.T.M.A.N.] [PATCH-maint] " Sven Eckelmann
  2010-05-21 15:25 ` [B.A.T.M.A.N.] [PATCH] " Marek Lindner
  0 siblings, 2 replies; 3+ messages in thread
From: Sven Eckelmann @ 2010-05-19 19:00 UTC (permalink / raw)
  To: b.a.t.m.a.n

A new buffer for a packet is created when a icmp packet is received.
This happens in a context with disabled irq. Thus we are not allowed to
sleep or call function which might sleep. kmalloc must be called with
GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
 batman-adv-kernelland/icmp_socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/batman-adv-kernelland/icmp_socket.c b/batman-adv-kernelland/icmp_socket.c
index 33d2714..becbb5b 100644
--- a/batman-adv-kernelland/icmp_socket.c
+++ b/batman-adv-kernelland/icmp_socket.c
@@ -292,7 +292,7 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
 	struct socket_packet *socket_packet;
 	unsigned long flags;
 
-	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_KERNEL);
+	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_ATOMIC);
 
 	if (!socket_packet)
 		return;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [B.A.T.M.A.N.] [PATCH-maint] batman-adv: Don't allocate icmp packet with GFP_KERNEL
  2010-05-19 19:00 [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL Sven Eckelmann
@ 2010-05-19 19:12 ` Sven Eckelmann
  2010-05-21 15:25 ` [B.A.T.M.A.N.] [PATCH] " Marek Lindner
  1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2010-05-19 19:12 UTC (permalink / raw)
  To: b.a.t.m.a.n

A new buffer for a packet is created when a icmp packet is received.
This happens in a context with disabled irq. Thus we are not allowed to
sleep or call function which might sleep. kmalloc must be called with
GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
---
This patch is created for maint and should be applied using `git am`.
Following patches should be applied before:
 * batman-adv: Move device for icmp injection to debugfs
 * batman-adv: Move tables from sysfs to debugfs
 * batman-adv: Call unregister_netdev on failures to get rtnl lock
 * batman-adv: Don't call free_netdev twice

 icmp_socket.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/icmp_socket.c b/icmp_socket.c
index eba8aa2..d74e2d6 100644
--- a/icmp_socket.c
+++ b/icmp_socket.c
@@ -284,7 +284,7 @@ static void bat_socket_add_packet(struct socket_client *socket_client,
 	struct socket_packet *socket_packet;
 	unsigned long flags;
 
-	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_KERNEL);
+	socket_packet = kmalloc(sizeof(struct socket_packet), GFP_ATOMIC);
 
 	if (!socket_packet)
 		return;
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL
  2010-05-19 19:00 [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL Sven Eckelmann
  2010-05-19 19:12 ` [B.A.T.M.A.N.] [PATCH-maint] " Sven Eckelmann
@ 2010-05-21 15:25 ` Marek Lindner
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2010-05-21 15:25 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Thursday 20 May 2010 03:00:00 Sven Eckelmann wrote:
> A new buffer for a packet is created when a icmp packet is received.
> This happens in a context with disabled irq. Thus we are not allowed to
> sleep or call function which might sleep. kmalloc must be called with
> GFP_ATOMIC instead of GFP_KERNEL to ensure that it does not sleep.

Applied in rev 1671.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-21 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-19 19:00 [B.A.T.M.A.N.] [PATCH] batman-adv: Don't allocate icmp packet with GFP_KERNEL Sven Eckelmann
2010-05-19 19:12 ` [B.A.T.M.A.N.] [PATCH-maint] " Sven Eckelmann
2010-05-21 15:25 ` [B.A.T.M.A.N.] [PATCH] " Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).