From: Rusty Russell <rusty@rustcorp.com.au>
To: stable@kernel.org
Cc: Bruce Rogers <brogers@novell.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
netdev@vger.kernel.org
Subject: [PATCH] virtio_net: indicate oom when addbuf returns failure
Date: Fri, 4 Jun 2010 10:28:56 +0930 [thread overview]
Message-ID: <201006041028.56798.rusty@rustcorp.com.au> (raw)
This patch is a subset of an already upstream patch, but this portion
is useful in earlier releases.
Please consider for the 2.6.32 and 2.6.33 stable trees.
If the add_buf operation fails, indicate failure to the caller.
Signed-off-by: Bruce Rogers <brogers@novell.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -318,6 +318,7 @@ static bool try_fill_recv_maxbufs(struct
skb_unlink(skb, &vi->recv);
trim_pages(vi, skb);
kfree_skb(skb);
+ oom = true;
break;
}
vi->num++;
@@ -368,6 +369,7 @@ static bool try_fill_recv(struct virtnet
if (err < 0) {
skb_unlink(skb, &vi->recv);
kfree_skb(skb);
+ oom = true;
break;
}
vi->num++;
next reply other threads:[~2010-06-04 0:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 0:58 Rusty Russell [this message]
2010-06-04 16:05 ` [stable] [PATCH] virtio_net: indicate oom when addbuf returns failure Greg KH
2010-06-06 20:13 ` Michael S. Tsirkin
2010-06-06 22:24 ` Herbert Xu
2010-06-07 2:24 ` Rusty Russell
2010-06-07 2:24 ` Rusty Russell
2010-06-07 9:15 ` Michael S. Tsirkin
2010-06-06 22:24 ` Herbert Xu
2010-06-07 2:17 ` Rusty Russell
2010-06-07 2:17 ` Rusty Russell
2010-06-10 15:46 ` Bruce Rogers
2010-06-10 15:46 ` Bruce Rogers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201006041028.56798.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=brogers@novell.com \
--cc=herbert@gondor.apana.org.au \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.