diff options
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 3fd31dec8c9c..a6278e7e61a0 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -380,6 +380,7 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr, | |||
380 | rbdc = __rbd_client_find(opt); | 380 | rbdc = __rbd_client_find(opt); |
381 | if (rbdc) { | 381 | if (rbdc) { |
382 | ceph_destroy_options(opt); | 382 | ceph_destroy_options(opt); |
383 | kfree(rbd_opts); | ||
383 | 384 | ||
384 | /* using an existing client */ | 385 | /* using an existing client */ |
385 | kref_get(&rbdc->kref); | 386 | kref_get(&rbdc->kref); |
@@ -406,15 +407,15 @@ done_err: | |||
406 | 407 | ||
407 | /* | 408 | /* |
408 | * Destroy ceph client | 409 | * Destroy ceph client |
410 | * | ||
411 | * Caller must hold node_lock. | ||
409 | */ | 412 | */ |
410 | static void rbd_client_release(struct kref *kref) | 413 | static void rbd_client_release(struct kref *kref) |
411 | { | 414 | { |
412 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); | 415 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); |
413 | 416 | ||
414 | dout("rbd_release_client %p\n", rbdc); | 417 | dout("rbd_release_client %p\n", rbdc); |
415 | spin_lock(&node_lock); | ||
416 | list_del(&rbdc->node); | 418 | list_del(&rbdc->node); |
417 | spin_unlock(&node_lock); | ||
418 | 419 | ||
419 | ceph_destroy_client(rbdc->client); | 420 | ceph_destroy_client(rbdc->client); |
420 | kfree(rbdc->rbd_opts); | 421 | kfree(rbdc->rbd_opts); |
@@ -427,7 +428,9 @@ static void rbd_client_release(struct kref *kref) | |||
427 | */ | 428 | */ |
428 | static void rbd_put_client(struct rbd_device *rbd_dev) | 429 | static void rbd_put_client(struct rbd_device *rbd_dev) |
429 | { | 430 | { |
431 | spin_lock(&node_lock); | ||
430 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); | 432 | kref_put(&rbd_dev->rbd_client->kref, rbd_client_release); |
433 | spin_unlock(&node_lock); | ||
431 | rbd_dev->rbd_client = NULL; | 434 | rbd_dev->rbd_client = NULL; |
432 | rbd_dev->client = NULL; | 435 | rbd_dev->client = NULL; |
433 | } | 436 | } |