Andrew Jones
2012-Feb-16 12:16 UTC
[PATCH] blkfront: don't put bdev right after getting it
We should hang onto bdev until we're done with it. Signed-off-by: Andrew Jones <drjones at 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
Konrad Rzeszutek Wilk
2012-Feb-16 19:44 UTC
[Xen-devel] [PATCH] blkfront: don't put bdev right after getting it
On Thu, Feb 16, 2012 at 01:16:25PM +0100, Andrew Jones wrote:> We should hang onto bdev until we're done with it.Looks ok. Is there a BZ that sparked this? Thanks.> > Signed-off-by: Andrew Jones <drjones at 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 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel at lists.xensource.com > http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2012-Feb-21 14:58 UTC
[PATCH] blkfront: don't put bdev right after getting it
On Thu, Feb 16, 2012 at 01:16:25PM +0100, Andrew Jones wrote:> We should hang onto bdev until we're done with it.applied in #testing> > Signed-off-by: Andrew Jones <drjones at 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