Linux virtualization list
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: xen-devel@lists.xensource.com
Cc: jeremy@goop.org, virtualization@lists.linux-foundation.org,
	konrad.wilk@oracle.com
Subject: [PATCH] blkfront: don't put bdev right after getting it
Date: Thu, 16 Feb 2012 13:16:25 +0100	[thread overview]
Message-ID: <1329394585-10129-1-git-send-email-drjones@redhat.com> (raw)

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

             reply	other threads:[~2012-02-16 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16 12:16 Andrew Jones [this message]
2012-02-16 19:44 ` [Xen-devel] [PATCH] blkfront: don't put bdev right after getting it Konrad Rzeszutek Wilk
2012-02-17 12:03   ` Andrew Jones
2012-02-21 14:58 ` Konrad Rzeszutek Wilk

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=1329394585-10129-1-git-send-email-drjones@redhat.com \
    --to=drjones@redhat.com \
    --cc=jeremy@goop.org \
    --cc=konrad.wilk@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xensource.com \
    /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