]> git.baikalelectronics.ru Git - kernel.git/commit
macvtap: handle ubuf refcount correctly when meet errors
authorJason Wang <jasowang@redhat.com>
Wed, 30 Nov 2016 05:17:52 +0000 (13:17 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 30 Nov 2016 20:06:02 +0000 (15:06 -0500)
commit2e2d0b5ceb4654ab720c90d45cffdbcc6f678fb8
tree73db65b94d0c8607ba2088178b6f00fa51bcc920
parent8bfe53942a1469cfc5413692f8e743e32682d9f5
macvtap: handle ubuf refcount correctly when meet errors

We trigger uarg->callback() immediately after we decide do datacopy
even if caller want to do zerocopy. This will cause the callback
(vhost_net_zerocopy_callback) decrease the refcount. But when we meet
an error afterwards, the error handling in vhost handle_tx() will try
to decrease it again. This is wrong and fix this by delay the
uarg->callback() until we're sure there's no errors.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvtap.c