From: Sage Weil Date: Sat, 7 Mar 2015 01:43:11 +0000 (-0800) Subject: crush: parse alg names that include a digit X-Git-Tag: v0.94~54^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=61308cc4734928b146080bbb18e9bca27ec57a07;p=ceph.git crush: parse alg names that include a digit The str_p("straw2") won't parse straw2, it seems because the digit is throwing it off. Use the existing name rule instead which is more robust. Note that not constraining the alg value here is better anyway because instead of a 'cannot parse' error that is hard to debug we instead get a 'unknown alg foo' error when doing the semantic pass. Fixes: #11015 Signed-off-by: Sage Weil --- diff --git a/src/crush/grammar.h b/src/crush/grammar.h index 61709185ef58..de77696aca9c 100644 --- a/src/crush/grammar.h +++ b/src/crush/grammar.h @@ -113,11 +113,7 @@ struct crush_grammar : public grammar // buckets bucket_id = str_p("id") >> negint; - bucket_alg = str_p("alg") >> ( str_p("uniform") | - str_p("list") | - str_p("tree") | - str_p("straw") | - str_p("straw2")); + bucket_alg = str_p("alg") >> name; bucket_hash = str_p("hash") >> ( integer | str_p("rjenkins1") ); bucket_item = str_p("item") >> name