summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2010-09-08 18:07:01 +0200
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 12:35:38 +0200
commit05447420f99c1c44063c7f00054667c022cc1365 (patch)
tree9d70e7c0037d821784b76d9d7d99c174c73d0576 /drivers/md
parent6a8736d10cb413be95ea443ba40f25c93f4ef9b2 (diff)
downloadop-kernel-dev-05447420f99c1c44063c7f00054667c022cc1365.zip
op-kernel-dev-05447420f99c1c44063c7f00054667c022cc1365.tar.gz
dm: fix locking context in queue_io()
Now queue_io() is called from dec_pending(), which may be called with interrupts disabled, so queue_io() must not enable interrupts unconditionally and must save/restore the current interrupts status. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 2011704..cd2f7e7 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -512,9 +512,11 @@ static void end_io_acct(struct dm_io *io)
*/
static void queue_io(struct mapped_device *md, struct bio *bio)
{
- spin_lock_irq(&md->deferred_lock);
+ unsigned long flags;
+
+ spin_lock_irqsave(&md->deferred_lock, flags);
bio_list_add(&md->deferred, bio);
- spin_unlock_irq(&md->deferred_lock);
+ spin_unlock_irqrestore(&md->deferred_lock, flags);
queue_work(md->wq, &md->work);
}
OpenPOWER on IntegriCloud