From patchwork Wed Jul 30 00:55:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Xue, Chendi" X-Patchwork-Id: 4643971 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7EBDEC0338 for ; Wed, 30 Jul 2014 00:55:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C176620142 for ; Wed, 30 Jul 2014 00:55:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95E692012D for ; Wed, 30 Jul 2014 00:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754590AbaG3Azm (ORCPT ); Tue, 29 Jul 2014 20:55:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:47993 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754572AbaG3Azm convert rfc822-to-8bit (ORCPT ); Tue, 29 Jul 2014 20:55:42 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 29 Jul 2014 17:49:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,760,1400050800"; d="scan'208,223";a="550994753" Received: from fmsmsx104.amr.corp.intel.com ([10.19.9.35]) by orsmga001.jf.intel.com with ESMTP; 29 Jul 2014 17:55:16 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX104.amr.corp.intel.com (10.19.9.35) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 29 Jul 2014 17:55:16 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.52]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.26]) with mapi id 14.03.0123.003; Wed, 30 Jul 2014 08:55:14 +0800 From: "Xue, Chendi" To: "ceph-devel@vger.kernel.org" Subject: [PATCH]init-ceph: Adding do_cmd_okfail when calling ceph-crush-location Thread-Topic: [PATCH]init-ceph: Adding do_cmd_okfail when calling ceph-crush-location Thread-Index: Ac+rkOixdALZUhUISBO9USaTiPKHYA== Date: Wed, 30 Jul 2014 00:55:13 +0000 Message-ID: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 797dbf4f027200bb22ba89d2f616e254321ec023 Mon Sep 17 00:00:00 2001 From: Chendi Xue Date: Tue, 29 Jul 2014 16:45:45 +0800 Subject: [PATCH 8/8] Adding do_cmd_okfail when calling ceph-crush-location Original init-ceph doesn't use do_cmd_okfail when getting osd_location, which results in osds wrong mapping( verified by using "ceph osd tree" ) Signed-off-by: Chendi Xue --- src/init-ceph.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/init-ceph.in b/src/init-ceph.in index 86eb87f..09c7cbc 100644 --- a/src/init-ceph.in +++ b/src/init-ceph.in @@ -327,7 +327,7 @@ for name in $what; do                                if [ "${update_crush:-1}" = "1" -o "${update_crush:-1}" = "true" ]; then                                    # update location in crush                                    get_conf osd_location_hook "$BINDIR/ceph-crush-location" "osd crush location hook" -                                  osd_location=`$osd_location_hook --cluster ceph --id $id --type osd` +                                 osd_location=$(do_cmd_okfail "$osd_location_hook --cluster ceph --id $id --type osd")                                    get_conf osd_weight "" "osd crush initial weight"                                    defaultweight="$(df -P -k $osd_data/. | tail -1 | awk '{ print sprintf("%.2f",$2/1073741824) }')"                                    get_conf osd_keyring "$osd_data/keyring" "keyring"