diff options
-rw-r--r-- | drivers/block/rbd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 7d8f8ddb3359..7f40cb4553c9 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -407,15 +407,15 @@ done_err: | |||
407 | 407 | ||
408 | /* | 408 | /* |
409 | * Destroy ceph client | 409 | * Destroy ceph client |
410 | * | ||
411 | * Caller must hold node_lock. | ||
410 | */ | 412 | */ |
411 | static void rbd_client_release(struct kref *kref) | 413 | static void rbd_client_release(struct kref *kref) |
412 | { | 414 | { |
413 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); | 415 | struct rbd_client *rbdc = container_of(kref, struct rbd_client, kref); |
414 | 416 | ||
415 | dout("rbd_release_client %p\n", rbdc); | 417 | dout("rbd_release_client %p\n", rbdc); |
416 | spin_lock(&node_lock); | ||
417 | list_del(&rbdc->node); | 418 | list_del(&rbdc->node); |
418 | spin_unlock(&node_lock); | ||
419 | 419 | ||
420 | ceph_destroy_client(rbdc->client); | 420 | ceph_destroy_client(rbdc->client); |
421 | kfree(rbdc->rbd_opts); | 421 | kfree(rbdc->rbd_opts); |
@@ -428,7 +428,9 @@ static void rbd_client_release(struct kref *kref) | |||
428 | */ | 428 | */ |
429 | static void rbd_put_client(struct rbd_device *rbd_dev) | 429 | static void rbd_put_client(struct rbd_device *rbd_dev) |
430 | { | 430 | { |
431 | spin_lock(&node_lock); | ||
431 | 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); | ||
432 | rbd_dev->rbd_client = NULL; | 434 | rbd_dev->rbd_client = NULL; |
433 | rbd_dev->client = NULL; | 435 | rbd_dev->client = NULL; |
434 | } | 436 | } |