WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] failing more nicely when trying to allocate too big pack

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] failing more nicely when trying to allocate too big packet
From: Xen patchbot -2.0-testing <patchbot-2.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Aug 2005 22:34:15 -0400
Delivery-date: Fri, 19 Aug 2005 02:34:48 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User vh249@xxxxxxxxxxxxxxxxxxxxxx
# Node ID d1a7b01d85b627906560f45e08db749993b092cc
# Parent  35801a414624343b727b87469e4cc6903c6b0db7
failing more nicely when trying to allocate too big packet

Signed-off-by: Vincent Hanquez <vincent@xxxxxxxxxxxxx>

diff -r 35801a414624 -r d1a7b01d85b6 
linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c
--- a/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Mon Aug 15 12:13:41 2005
+++ b/linux-2.6-xen-sparse/arch/xen/kernel/skbuff.c     Wed Aug 17 21:49:24 2005
@@ -27,6 +27,11 @@
 struct sk_buff *__dev_alloc_skb(unsigned int length, int gfp_mask)
 {
     struct sk_buff *skb;
+
+    if (unlikely(length + 16 > PAGE_SIZE)) {
+        printk(KERN_ERR "error: allocating skb: too big packet (%d)\n", 
length);
+        return NULL;
+    }
     skb = alloc_skb_from_cache(skbuff_cachep, length + 16, gfp_mask);
     if ( likely(skb != NULL) )
         skb_reserve(skb, 16);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] failing more nicely when trying to allocate too big packet, Xen patchbot -2 . 0-testing <=