All of lore.kernel.org
 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

* Re: [Xen-devel] [PATCH] blkfront: don't put bdev right after getting it
  2012-02-16 12:16 [PATCH] blkfront: don't put bdev right after getting it Andrew Jones
@ 2012-02-16 19:44 ` Konrad Rzeszutek Wilk
  2012-02-17 12:03   ` Andrew Jones
  2012-02-21 14:58 ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-02-16 19:44 UTC (permalink / raw)
  To: Andrew Jones; +Cc: jeremy, xen-devel, konrad.wilk, virtualization

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@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@lists.xensource.com
> http://lists.xensource.com/xen-devel

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

* Re: [Xen-devel] [PATCH] blkfront: don't put bdev right after getting it
  2012-02-16 19:44 ` [Xen-devel] " Konrad Rzeszutek Wilk
@ 2012-02-17 12:03   ` Andrew Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Jones @ 2012-02-17 12:03 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: jeremy, xen-devel, konrad wilk, virtualization



----- Original Message -----
> 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.

Nope. Just came across it while I was looking at the code.

Drew

> > 
> > 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
> > 
> > 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 

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

* Re: [PATCH] blkfront: don't put bdev right after getting it
  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-21 14:58 ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-02-21 14:58 UTC (permalink / raw)
  To: Andrew Jones; +Cc: jeremy, xen-devel, virtualization

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@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	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.