From patchwork Sat Apr 27 12:38:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2497151 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6B2183FC64 for ; Sat, 27 Apr 2013 12:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755630Ab3D0MiI (ORCPT ); Sat, 27 Apr 2013 08:38:08 -0400 Received: from mail-ia0-f170.google.com ([209.85.210.170]:57416 "EHLO mail-ia0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755196Ab3D0MiH (ORCPT ); Sat, 27 Apr 2013 08:38:07 -0400 Received: by mail-ia0-f170.google.com with SMTP id k20so1360735iak.1 for ; Sat, 27 Apr 2013 05:38:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=tq4nDenXrYK5OF24zhpyJJgmENW1TmLdEtJOWMxThh4=; b=co19KV0uUDlimG58Orx4bA1Bjx/G1IWPnegcfGb92MZKINBe7V7Q6HsshPfoPUHLAw 0so8vRwkY40CEJGeDwaNqc8h54aaZY29A6M8LSfcJ/cJp40zA4SxGmlNFZkgWWmzvSCk IHATEg0DRF8xAfF0h/e6ihelJl1Sqz9dhLu7bXuaSDJB8/yIrVZOigNNmJjM1eZ3e5iE YHJ4O5IHEUVV+V6SNRbbYaRe2Z5B4RjcLqs3F6SscxRbhi95BEoxFTwVrakd6pUWTSc4 ERgp4q7ERd9KYjHa8lwJ4/ZFrzWBL7228YF+4jxucuX61jIXfcnO5InFXnOcYOaVO8kS v5Yg== X-Received: by 10.50.180.197 with SMTP id dq5mr3948238igc.22.1367066287207; Sat, 27 Apr 2013 05:38:07 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPSA id w8sm7705344igl.9.2013.04.27.05.38.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Apr 2013 05:38:06 -0700 (PDT) Message-ID: <517BC6AE.3010304@inktank.com> Date: Sat, 27 Apr 2013 07:38:06 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 6/6] rbd: probe for the parent earlier References: <517BC608.5030008@inktank.com> In-Reply-To: <517BC608.5030008@inktank.com> X-Gm-Message-State: ALoCoQmq1ZAbnOPSEWBObxIhGqm6BWUC+w3chacBgZE6lQmApezS0GsXq6SCMr+41U3DBxbNFvSu Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Probe for a parent device earlier in rbd_dev_probe_finish(), before starting to set up the Linux side of the rbd device. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) @@ -4781,10 +4785,6 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) * of the sysfs code (initiated by rbd_bus_del_dev()). */ - ret = rbd_dev_probe_parent(rbd_dev); - if (ret) - goto err_out_bus; - ret = rbd_dev_header_watch_sync(rbd_dev, 1); if (ret) goto err_out_bus; @@ -4806,8 +4806,6 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) return ret; err_out_bus: - if (rbd_dev->parent) - rbd_dev_remove_parent(rbd_dev); rbd_bus_del_dev(rbd_dev); return ret; @@ -4817,6 +4815,8 @@ err_out_blkdev: unregister_blkdev(rbd_dev->major, rbd_dev->name); err_out_id: rbd_dev_id_put(rbd_dev); + if (rbd_dev->parent); + rbd_dev_remove_parent(rbd_dev); err_out_snaps: rbd_remove_all_snaps(rbd_dev); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c81b319..5fd923f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4751,6 +4751,10 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) if (ret) goto err_out_snaps; + ret = rbd_dev_probe_parent(rbd_dev); + if (ret) + goto err_out_snaps; + /* generate unique id: find highest unique id, add one */ rbd_dev_id_get(rbd_dev);