From patchwork Tue Apr 25 09:33:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9697771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7205D601D3 for ; Tue, 25 Apr 2017 09:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F5C128438 for ; Tue, 25 Apr 2017 09:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6455C2857D; Tue, 25 Apr 2017 09:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071A428438 for ; Tue, 25 Apr 2017 09:34:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1428719AbdDYJeg (ORCPT ); Tue, 25 Apr 2017 05:34:36 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:35642 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1428696AbdDYJeN (ORCPT ); Tue, 25 Apr 2017 05:34:13 -0400 Received: by mail-qt0-f193.google.com with SMTP id o36so24161393qtb.2 for ; Tue, 25 Apr 2017 02:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=Bb3Kd9ZkCm4Fm4yqaWf4BczchbzHK2WxHWo7OYAUan4=; b=af3WwplKVd63qFVrrwfEMe9mAVoSInlvIGLqoL25anUT3XTx8ya90iiwTcV+zd8HG/ LiHzuhRxF2f95p6ub08NNx3vdDck9vgEPvSwjuEvYQsi3BUYOPxVgaVXHQWsbl7q9lIP vHDHCSw8zlStMOA3YU5V76KPtLlDgkuFEeGcPy7Bqz+UD9Uqd75WJATeX55zzeBOLwNr bImAhfpYfGbalss9pE5fR7Nh5/8GQ51eywJ9Il4vVzxxlNTftiyBkDW44M8d95XV7YJR 8O/2mWp2zjhdVzqd9kPtveJiSArhaMcIxldM57KDd9sy+d+oY9VoLL7XlQaer6NAny3h CL+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Bb3Kd9ZkCm4Fm4yqaWf4BczchbzHK2WxHWo7OYAUan4=; b=LtPckpV/wyrFSgeXgx/u3MPJ0GbH6LdghiUC2KGZooGtGm0eUDRDV/epLk/jv8QPOa H/TJZlxzz7fcObVi/tsRqkImRYmI0Q3WqUOZaYhCAGFzhzgGc3mPNn69wK+9fhX1+DmL dbL9ky2VLlcGWnxELN5qsJf35nmlp4n8mkTNlOFhJLK1cSLt15IDlIb9g4/4apB+jSb/ igPhtrvGo5YYzs7otPHTzxcjw3aqblhyVog/aSsntLJX8BWjecN/lhFXm5EIJBVNhj6H Qbmn4bp8WcRexL3tbt9TgGyCrmuGRIF1Onw5rE1W0q7q4GUb0P0fDtAQ4ZXAZfBcZAIe snOg== X-Gm-Message-State: AN3rC/42iECj5Hs4vA13yx76FGnijtsVP6kS0Oc0g0cea++loh5BX4fh WGYVIKLxmd71fHbSDYU= X-Received: by 10.200.51.70 with SMTP id u6mr29355648qta.122.1493112852507; Tue, 25 Apr 2017 02:34:12 -0700 (PDT) Received: from orange.brq.redhat.com. (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id w6sm7461396qta.50.2017.04.25.02.34.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Apr 2017 02:34:12 -0700 (PDT) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Subject: [PATCH 1/9] rbd: move rbd_dev_destroy() call out of rbd_dev_image_release() Date: Tue, 25 Apr 2017 11:33:37 +0200 Message-Id: <1493112825-16403-2-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1493112825-16403-1-git-send-email-idryomov@gmail.com> References: <1493112825-16403-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ... to simplify error handling in do_rbd_add(). Signed-off-by: Ilya Dryomov --- drivers/block/rbd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 2fb0a7a76d8e..2effa3e8f96c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -5967,8 +5967,6 @@ static void rbd_dev_image_release(struct rbd_device *rbd_dev) rbd_dev->image_format = 0; kfree(rbd_dev->spec->image_id); rbd_dev->spec->image_id = NULL; - - rbd_dev_destroy(rbd_dev); } /* @@ -6135,8 +6133,7 @@ static ssize_t do_rbd_add(struct bus_type *bus, * commit 1f3ef78861ac. */ rbd_unregister_watch(rbd_dev); - rbd_dev_image_release(rbd_dev); - goto out; + goto err_out_image_probe; } rc = count; @@ -6144,6 +6141,8 @@ static ssize_t do_rbd_add(struct bus_type *bus, module_put(THIS_MODULE); return rc; +err_out_image_probe: + rbd_dev_image_release(rbd_dev); err_out_rbd_dev: rbd_dev_destroy(rbd_dev); err_out_client: @@ -6203,6 +6202,7 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) } rbd_assert(second); rbd_dev_image_release(second); + rbd_dev_destroy(second); first->parent = NULL; first->parent_overlap = 0; @@ -6285,7 +6285,7 @@ static ssize_t do_rbd_remove(struct bus_type *bus, */ rbd_dev_device_release(rbd_dev); rbd_dev_image_release(rbd_dev); - + rbd_dev_destroy(rbd_dev); return count; }