Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-28 Thread Neil Horman
On Fri, Mar 25, 2016 at 03:16:36PM -0400, David Miller wrote: > From: Bjorn Helgaas > Date: Fri, 25 Mar 2016 11:46:39 -0500 > > > You're right, there is an issue here. I reproduced a problem with a > > bond device. bond_netpoll_setup() calls __netpoll_setup() directly > > (not netpoll_setup()).

Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-25 Thread David Miller
From: Bjorn Helgaas Date: Fri, 25 Mar 2016 11:46:39 -0500 > You're right, there is an issue here. I reproduced a problem with a > bond device. bond_netpoll_setup() calls __netpoll_setup() directly > (not netpoll_setup()). I'll debug it more; just wanted to let you > know there *is* a problem w

Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-25 Thread Bjorn Helgaas
On Fri, Mar 25, 2016 at 07:33:42AM -0400, Neil Horman wrote: > On Thu, Mar 24, 2016 at 09:56:21PM -0500, Bjorn Helgaas wrote: > > netpoll_setup() does a dev_hold() on np->dev, the netpoll device. If it > > fails, it correctly does a dev_put() but leaves np->dev set. If we call > > netpoll_cleanup

Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-25 Thread David Miller
From: Bjorn Helgaas Date: Thu, 24 Mar 2016 21:56:21 -0500 > netpoll_setup() does a dev_hold() on np->dev, the netpoll device. If it > fails, it correctly does a dev_put() but leaves np->dev set. If we call > netpoll_cleanup() after the failure, np->dev is still set so we do another > dev_put(),

Re: [PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-25 Thread Neil Horman
On Thu, Mar 24, 2016 at 09:56:21PM -0500, Bjorn Helgaas wrote: > netpoll_setup() does a dev_hold() on np->dev, the netpoll device. If it > fails, it correctly does a dev_put() but leaves np->dev set. If we call > netpoll_cleanup() after the failure, np->dev is still set so we do another > dev_put

[PATCH v2] netpoll: Fix extra refcount release in netpoll_cleanup()

2016-03-24 Thread Bjorn Helgaas
netpoll_setup() does a dev_hold() on np->dev, the netpoll device. If it fails, it correctly does a dev_put() but leaves np->dev set. If we call netpoll_cleanup() after the failure, np->dev is still set so we do another dev_put(), which decrements the refcount an extra time. It's questionable to