From: Glauber de Oliveira Costa <gcosta@redhat.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Sleeping with spinlock held
Date: Mon, 9 Oct 2006 16:30:47 -0300 [thread overview]
Message-ID: <20061009193047.GA28540@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 403 bytes --]
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"
[-- Attachment #2: flush_work.patch --]
[-- Type: text/plain, Size: 855 bytes --]
--- 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) {
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-10-09 19:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 19:30 Glauber de Oliveira Costa [this message]
2006-10-09 19:39 ` [PATCH] Sleeping with spinlock held Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2006-10-09 17:22 Glauber de Oliveira Costa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061009193047.GA28540@redhat.com \
--to=gcosta@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.