Dan Carpenter
2012-Jan-03 14:45 UTC
[patch] virtio_blk: lock() => unlock() typo in virtblk_config_changed_work()
This will deadlock. Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index f3d77b3..ba73661 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -352,7 +352,7 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); done: - mutex_lock(&vblk->config_lock); + mutex_unlock(&vblk->config_lock); } static void virtblk_config_changed(struct virtio_device *vdev)
Michael S. Tsirkin
2012-Jan-03 15:31 UTC
[patch] virtio_blk: lock() => unlock() typo in virtblk_config_changed_work()
On Tue, Jan 03, 2012 at 05:45:13PM +0300, Dan Carpenter wrote:> This will deadlock. > > Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > index f3d77b3..ba73661 100644 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -352,7 +352,7 @@ static void virtblk_config_changed_work(struct work_struct *work) > > set_capacity(vblk->disk, capacity); > done: > - mutex_lock(&vblk->config_lock); > + mutex_unlock(&vblk->config_lock); > } > > static void virtblk_config_changed(struct virtio_device *vdev)Good catch. Acked-by: Michael S. Tsirkin <mst at redhat.com>
Rusty Russell
2012-Jan-04 02:32 UTC
[patch] virtio_blk: lock() => unlock() typo in virtblk_config_changed_work()
On Tue, 3 Jan 2012 17:31:28 +0200, "Michael S. Tsirkin" <mst at redhat.com> wrote:> On Tue, Jan 03, 2012 at 05:45:13PM +0300, Dan Carpenter wrote: > > This will deadlock. > > > > Signed-off-by: Dan Carpenter <dan.carpenter at oracle.com> > > > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > > index f3d77b3..ba73661 100644 > > --- a/drivers/block/virtio_blk.c > > +++ b/drivers/block/virtio_blk.c > > @@ -352,7 +352,7 @@ static void virtblk_config_changed_work(struct work_struct *work) > > > > set_capacity(vblk->disk, capacity); > > done: > > - mutex_lock(&vblk->config_lock); > > + mutex_unlock(&vblk->config_lock); > > } > > > > static void virtblk_config_changed(struct virtio_device *vdev) > > Good catch. > Acked-by: Michael S. Tsirkin <mst at redhat.com>Indeed, I folded it into that patch. Thanks! Rusty.