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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

I got a trouble that mkcephfs will have wrong "maxosd" when you have
ceph.conf with OSD ids in random order like:

[osd2]
...
[osd0]
...
[osd1]
...

In this case, you will got "2" for the "maxosd", instead of 3.
After adding a sort, the problem seems solved.


Cheers,
CC Lien

Signed-off-by: CC Lien <cc_lien@xxxxxxxxxxxxxxxxxxx>
---
 src/mkcephfs.in |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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
-- 
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux