Commit aa196ee
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>1 parent af1cc7a commit aa196ee
1 file changed
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
746 | 746 | | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | | - | |
752 | 747 | | |
753 | 748 | | |
754 | 749 | | |
| |||
779 | 774 | | |
780 | 775 | | |
781 | 776 | | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
782 | 780 | | |
| 781 | + | |
783 | 782 | | |
784 | 783 | | |
785 | 784 | | |
| |||
0 commit comments