blkfront: don't put bdev right after getting it
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/xen-blkfront.c +1 -1
@@ -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 ; }
Signature · 1 line
1.7.7.5
Quoted 1 line · Andrew Jones
We should hang onto bdev until we're done with it.
Looks ok. Is there a BZ that sparked this? Thanks.
Quoted 34 lines
Signed-off-by Andrew Jones <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +1
-1@@ -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 ; }Signature · 7 lines
1.7.7.5 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xensource.com/xen-devel
----- Original Message -----
Quoted 4 lines · Andrew Jones
Quoted 1 line
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
Quoted 38 lines
Quoted 37 lines
Signed-off-by Andrew Jones <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +0
-1@@ -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)drivers/block/xen-blkfront.c +1
-0goto 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
[email protected]
http://lists.xensource.com/xen-devel
Quoted 1 line · Andrew Jones
We should hang onto bdev until we're done with it.
applied in #testing
Quoted 28 lines
Signed-off-by Andrew Jones <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +1
-1@@ -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 ; }Signature · 1 line
1.7.7.5