From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Shah Subject: Re: [PATCH 0/2] Fix hot-unplug: device removal while port in use Date: Wed, 2 Mar 2011 19:08:35 +0530 Message-ID: <20110302133835.GA3055@amit-x200.redhat.com> References: <87aahdn5k7.fsf@rustcorp.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <87aahdn5k7.fsf@rustcorp.com.au> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Rusty Russell Cc: Virtualization List List-Id: virtualization@lists.linuxfoundation.org On (Wed) 02 Mar 2011 [21:38:08], Rusty Russell wrote: > On Wed, 2 Mar 2011 13:53:06 +0530, Amit Shah wrote: > > A crash was observed when a device gets removed while a port is in > > use. When the port gets removed, we tried to free vq buffers. The vq > > no longer exists at this stage, just ensure we don't access it. > > > > The second patch fixes a warning where the pci region is already > > freed. I'm not sure what or how the region gets freed, any clues > > there will be helpful. > > Put a printk and WARN_ON() in the pci region freeing code, look through > the backtraces? Well what seems to be happening is kref_put() in port_fops_release() calls remove_port(), which calls device_destroy(). Now this triggers another fput() on the same file, causing port_fops_release() to be called again, which leads to device_destroy() being called on the same region. Slightly more clueful, but still clueless as to why this happens. Amit