xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blkfront: don't put bdev right after getting it
@ 2012-02-16 12:16 Andrew Jones
  2012-02-16 19:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
  2012-02-21 14:58 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Jones @ 2012-02-16 12:16 UTC (permalink / raw)
  To: xen-devel; +Cc: jeremy, virtualization, konrad.wilk

We should hang onto bdev until we're done with it.

Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 drivers/block/xen-blkfront.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 2f22874..5d45688 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1410,7 +1410,6 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
 	mutex_lock(&blkfront_mutex);
 
 	bdev = bdget_disk(disk, 0);
-	bdput(bdev);
 
 	if (bdev->bd_openers)
 		goto out;
@@ -1441,6 +1440,7 @@ static int blkif_release(struct gendisk *disk, fmode_t mode)
 	}
 
 out:
+	bdput(bdev);
 	mutex_unlock(&blkfront_mutex);
 	return 0;
 }
-- 
1.7.7.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-21 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-16 12:16 [PATCH] blkfront: don't put bdev right after getting it Andrew Jones
2012-02-16 19:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
2012-02-17 12:03   ` Andrew Jones
2012-02-21 14:58 ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).