Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 375610
b: refs/heads/master
c: fb65d22
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder committed May 13, 2013
1 parent 0dcd31e commit 420ffd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8785b1d487f0a31afd2c802499786d3b355eccea
refs/heads/master: fb65d2284c117cfc28d30217d25a14a8e7a75a94
18 changes: 13 additions & 5 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1837,6 +1837,17 @@ static void rbd_obj_request_destroy(struct kref *kref)
kmem_cache_free(rbd_obj_request_cache, obj_request);
}

/* It's OK to call this for a device with no parent */

static void rbd_spec_put(struct rbd_spec *spec);
static void rbd_dev_unparent(struct rbd_device *rbd_dev)
{
rbd_dev_remove_parent(rbd_dev);
rbd_spec_put(rbd_dev->parent_spec);
rbd_dev->parent_spec = NULL;
rbd_dev->parent_overlap = 0;
}

/*
* Caller is responsible for filling in the list of object requests
* that comprises the image request, and the Linux request pointer
Expand Down Expand Up @@ -4491,10 +4502,7 @@ static void rbd_dev_unprobe(struct rbd_device *rbd_dev)
{
struct rbd_image_header *header;

rbd_dev_remove_parent(rbd_dev);
rbd_spec_put(rbd_dev->parent_spec);
rbd_dev->parent_spec = NULL;
rbd_dev->parent_overlap = 0;
rbd_dev_unparent(rbd_dev);

/* Free dynamic fields from the header, then zero it out */

Expand Down Expand Up @@ -4570,7 +4578,7 @@ static int rbd_dev_probe_parent(struct rbd_device *rbd_dev)
return 0;
out_err:
if (parent) {
rbd_spec_put(rbd_dev->parent_spec);
rbd_dev_unparent(rbd_dev);
kfree(rbd_dev->header_name);
rbd_dev_destroy(parent);
} else {
Expand Down

0 comments on commit 420ffd1

Please sign in to comment.