From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber de Oliveira Costa Subject: [PATCH] Sleeping with spinlock held Date: Mon, 9 Oct 2006 14:22:06 -0300 Message-ID: <20061009172205.GB27815@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="sm4nu43k4a2Rpi4c" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, In drivers/xen/blkfront/blkfront.c, flush_scheduled_work(), that might sleep, is being called with a spinlock held, thus triggering a BUG. I think it's safe to just poke it out from the locked region, as it seems to me we won't be receiving any more work at this time. In case you agree, I'm attaching a simple patch that fix this. -- Glauber de Oliveira Costa Red Hat Inc. "Free as in Freedom" --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="flush_work.patch" --- linux-2.6.18-orig/drivers/xen/blkfront//blkfront.c.orig 2006-10-07 10:28:25.000000000 -0400 +++ linux-2.6.18-orig/drivers/xen/blkfront//blkfront.c 2006-10-07 10:27:58.000000000 -0400 @@ -355,8 +355,8 @@ static void blkfront_closing(struct xenb blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - flush_scheduled_work(); spin_unlock_irqrestore(&blkif_io_lock, flags); + flush_scheduled_work(); xlvbd_del(info); @@ -714,8 +714,8 @@ static void blkif_free(struct blkfront_i blk_stop_queue(info->rq); /* No more gnttab callback work. */ gnttab_cancel_free_callback(&info->callback); - flush_scheduled_work(); spin_unlock_irq(&blkif_io_lock); + flush_scheduled_work(); /* Free resources associated with old device channel. */ if (info->ring_ref != GRANT_INVALID_REF) { --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --sm4nu43k4a2Rpi4c--