Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread Jason Wang
On 2020/12/14 上午11:56, Willem de Bruijn wrote: On Sun, Dec 13, 2020 at 10:54 PM Willem de Bruijn wrote: On Sun, Dec 13, 2020 at 10:30 PM Jason Wang wrote: On 2020/12/14 上午9:32, Willem de Bruijn wrote: On Sat, Dec 12, 2020 at 7:18 PM Willem de Bruijn wrote: afterwards, the error handling

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread Willem de Bruijn
On Sun, Dec 13, 2020 at 10:54 PM Willem de Bruijn wrote: > > On Sun, Dec 13, 2020 at 10:30 PM Jason Wang wrote: > > > > > > On 2020/12/14 上午9:32, Willem de Bruijn wrote: > > > On Sat, Dec 12, 2020 at 7:18 PM Willem de Bruijn > > > wrote: > > > afterwards, the error handling in vhost

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread Willem de Bruijn
On Sun, Dec 13, 2020 at 10:30 PM Jason Wang wrote: > > > On 2020/12/14 上午9:32, Willem de Bruijn wrote: > > On Sat, Dec 12, 2020 at 7:18 PM Willem de Bruijn > > wrote: > > afterwards, the error handling in vhost handle_tx() will try to > > decrease the same refcount again. This is wrong

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread Jason Wang
On 2020/12/14 上午9:32, Willem de Bruijn wrote: On Sat, Dec 12, 2020 at 7:18 PM Willem de Bruijn wrote: afterwards, the error handling in vhost handle_tx() will try to decrease the same refcount again. This is wrong and fix this by delay copying ubuf_info until we're sure there's no errors. I

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-13 Thread Willem de Bruijn
On Sat, Dec 12, 2020 at 7:18 PM Willem de Bruijn wrote: > > > > > afterwards, the error handling in vhost handle_tx() will try to > > > > decrease the same refcount again. This is wrong and fix this by delay > > > > copying ubuf_info until we're sure there's no errors. > > > > > > I think the

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-12 Thread Willem de Bruijn
> > > afterwards, the error handling in vhost handle_tx() will try to > > > decrease the same refcount again. This is wrong and fix this by delay > > > copying ubuf_info until we're sure there's no errors. > > > > I think the right approach is to address this in the error paths, rather > > than >

Re: [PATCH net v2] tun: fix ubuf refcount incorrectly on error path

2020-12-09 Thread Willem de Bruijn
On Wed, Dec 9, 2020 at 8:03 AM wangyunjian wrote: > > From: Yunjian Wang > > After setting callback for ubuf_info of skb, the callback > (vhost_net_zerocopy_callback) will be called to decrease > the refcount when freeing skb. But when an exception occurs With exception, you mean if