diff mbox

mkcephfs: Fix wrong maxosd when OSD ids are random ordered in ceph.conf

Message ID AANLkTimunpW727r2xM0itVW6iHRIxKTuYLK4kBHCsF3Z@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

CC Lien June 29, 2010, 2:29 p.m. UTC
None
diff mbox

Patch

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