From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Alex Nixon <alex.nixon@citrix.com>
Cc: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@citrix.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH] Xen: Fix warning when hot-unplugging virtual block devices
Date: Thu, 21 Aug 2008 13:13:08 -0700 [thread overview]
Message-ID: <48ADCC54.1000907@goop.org> (raw)
In-Reply-To: <48AD5373.201@citrix.com>
Alex Nixon wrote:
> From: Alex Nixon <alex.nixon@citrix.com>
> Date: Thu, 21 Aug 2008 12:30:54 +0100
> Subject: [PATCH] Xen: Fix warning when hot-unplugging virtual block devices
>
> WARNING: at kernel/softirq.c:136 local_bh_enable+0x3f/0x8a()
>
> del_gendisk needs IRQs enabled, as the code path eventually reaches local_bh_enable.
> blk_stop_queue needs them disabled - so do so temporarily.
>
> It shouldn't matter if an interrupt comes in whilst blkif_io_lock is held, as it will block on the lock. Upon acquisition, it'll realise the device is down and exit cleanly.
>
> Signed-off-by: Alex Nixon <alex.nixon@citrix.com>
>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Send a clean copy to Jens with my ack.
J
> ---
> drivers/block/xen-blkfront.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index d5e7532..95cee2c 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -899,16 +899,18 @@ static void blkfront_closing(struct xenbus_device *dev)
> if (info->rq == NULL)
> goto out;
>
> - spin_lock_irqsave(&blkif_io_lock, flags);
> + spin_lock(&blkif_io_lock);
>
> del_gendisk(info->gd);
>
> + local_irq_save(flags);
> /* No more blkif_request(). */
> blk_stop_queue(info->rq);
> + local_irq_restore(flags);
>
> /* No more gnttab callback work. */
> gnttab_cancel_free_callback(&info->callback);
> - spin_unlock_irqrestore(&blkif_io_lock, flags);
> + spin_unlock(&blkif_io_lock);
>
> /* Flush gnttab callback work. Must be done with no locks held. */
> flush_scheduled_work();
>
prev parent reply other threads:[~2008-08-21 20:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 11:37 [PATCH] Xen: Fix warning when hot-unplugging virtual block devices Alex Nixon
2008-08-21 20:13 ` Jeremy Fitzhardinge [this message]
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=48ADCC54.1000907@goop.org \
--to=jeremy@goop.org \
--cc=Jeremy.Fitzhardinge@citrix.com \
--cc=alex.nixon@citrix.com \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox