From patchwork Sat Apr 27 12:33:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2497071 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 8091CDF23A for ; Sat, 27 Apr 2013 12:33:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753499Ab3D0MdN (ORCPT ); Sat, 27 Apr 2013 08:33:13 -0400 Received: from mail-ia0-f182.google.com ([209.85.210.182]:39488 "EHLO mail-ia0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751975Ab3D0MdN (ORCPT ); Sat, 27 Apr 2013 08:33:13 -0400 Received: by mail-ia0-f182.google.com with SMTP id w33so2069562iag.13 for ; Sat, 27 Apr 2013 05:33:12 -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=RlYz755aqOHIaFqk5YJwipqxqOsLbZLpLDqYT/Vasdg=; b=WWiTiWg2F2WvvJEiUfigXn9cnPQEnGTfDmzQdQZt8cnX7ox8s2/ijuajp8+Fp8hwwI A/uQnGndkD/AzUHQjI1xUz1dedYiSfwfFXRKykUKuYw9Ic32C78kiukxPiywYzQsOuGY EFvuFXpqG5CVviz/rzYreitQNYENqnWDX0JXrojHlnvC80WoQJnztt0dX3dXEr21wlhr OJ5Xg/rhOHaNdhJqp9jPipNFu733HndD4rWvWf/mBY8GG8MINqet/+mLNHDqqbA+MQbI XQvOSKWzaEBFQjcyAnAHFr7UM1L+h95qghp+WRoE0wZOCT/x7iF4CDAD0mpb9GfohpJv OE9g== X-Received: by 10.42.50.202 with SMTP id b10mr26348242icg.7.1367065992512; Sat, 27 Apr 2013 05:33:12 -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 ua6sm7775933igb.0.2013.04.27.05.33.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 27 Apr 2013 05:33:11 -0700 (PDT) Message-ID: <517BC587.6000103@inktank.com> Date: Sat, 27 Apr 2013 07:33:11 -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 2/4] rbd: only set device exists flag when ready References: <517BC525.8090403@inktank.com> In-Reply-To: <517BC525.8090403@inktank.com> X-Gm-Message-State: ALoCoQnjHRaz/nqtuyc6LrBY9ZW6r2gCGZP9asPXt4hPascVPs80TfewoJZIK7WQ9iP1CsYg4QWp Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Hold off setting the EXISTS rbd device flag until just before we announce the disk as available for use. There's no point in doing so any earlier than that, and at that point the device truly is fully set up and ready to use. Signed-off-by: Alex Elder --- drivers/block/rbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) } @@ -4779,6 +4778,7 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) /* Everything's ready. Announce the disk to the world. */ + set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags); add_disk(rbd_dev->disk); pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name, diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b6f32c2..b04e3e1 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -881,7 +881,6 @@ static int rbd_dev_set_mapping(struct rbd_device *rbd_dev) rbd_dev->mapping.features = snap->features; rbd_dev->mapping.read_only = true; } - set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags); return 0;