bsg: fix the deadlock on discarding done commands
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Thu, 7 Jun 2007 11:24:06 +0000 (13:24 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 16 Jul 2007 06:52:46 +0000 (08:52 +0200)
The previous commit introduced a deadlock in discarding commands,
because we forget to unlock the bd spinlock.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/bsg.c

index 2f78d7d..5f4abc9 100644 (file)
@@ -471,6 +471,7 @@ static int bsg_complete_all_commands(struct bsg_device *bd)
                        spin_unlock_irq(&bd->lock);
                        break;
                }
+               spin_unlock_irq(&bd->lock);
 
                bc = bsg_get_done_cmd(bd);
                if (IS_ERR(bc))