From patchwork Tue Jun 29 14:29:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CC Lien X-Patchwork-Id: 108634 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5TFHBFT026855 for ; Tue, 29 Jun 2010 15:57:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754393Ab0F2O3P (ORCPT ); Tue, 29 Jun 2010 10:29:15 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:48222 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754445Ab0F2O3O (ORCPT ); Tue, 29 Jun 2010 10:29:14 -0400 Received: by pvc7 with SMTP id 7so148384pvc.19 for ; Tue, 29 Jun 2010 07:29:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.115.65.14 with SMTP id s14mr7513116wak.209.1277821751298; Tue, 29 Jun 2010 07:29:11 -0700 (PDT) Received: by 10.114.195.18 with HTTP; Tue, 29 Jun 2010 07:29:11 -0700 (PDT) X-Originating-IP: [220.135.41.194] Date: Tue, 29 Jun 2010 22:29:11 +0800 Message-ID: Subject: [PATCH] mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf From: CC Lien To: ceph-devel@vger.kernel.org Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 29 Jun 2010 15:58:07 +0000 (UTC) diff --git a/src/mkcephfs.in b/src/mkcephfs.in index 2edaad1..3cad4cf 100644 --- a/src/mkcephfs.in +++ b/src/mkcephfs.in @@ -110,7 +110,7 @@ if echo $what | grep -q mon0 ; then # build osdmap osdmap="/tmp/osdmap.$$" if [ -z "$numosd" ]; then - maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | tail -1 | cut -c 4-` + maxosd=`$CCONF -c $conf -l osd | egrep -v '^osd$' | cut -c 4- | sort -n | tail -1` numosd=$(($maxosd + 1)) echo max osd in $conf is $maxosd, num osd is $numosd fi