From: Kefu Chai Date: Mon, 12 Nov 2018 03:04:54 +0000 (+0800) Subject: erasure-code: return error using `ss` not derr X-Git-Tag: v14.1.0~905^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5b70ba8cdfd1e3adfd2f8d4b57e35428a3b3d7bd;p=ceph-ci.git erasure-code: return error using `ss` not derr log is not very visible from user's perspective. we'd better return the error message using the input parameter, if the technique is unsupported. also, remove the trailing newline, as `ss` will be sent back to user, it's the the front-end's responsibility to format the error message. Signed-off-by: Kefu Chai --- diff --git a/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc b/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc index 966c765565d..353b71b804e 100644 --- a/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc +++ b/src/erasure-code/jerasure/ErasureCodePluginJerasure.cc @@ -54,11 +54,10 @@ int ErasureCodePluginJerasure::factory(const std::string& directory, } else if (t == "liber8tion") { interface = new ErasureCodeJerasureLiber8tion(); } else { - derr << "technique=" << t << " is not a valid coding technique. " + *ss << "technique=" << t << " is not a valid coding technique. " << " Choose one of the following: " << "reed_sol_van, reed_sol_r6_op, cauchy_orig, " - << "cauchy_good, liberation, blaum_roth, liber8tion" - << dendl; + << "cauchy_good, liberation, blaum_roth, liber8tion"; return -ENOENT; } dout(20) << __func__ << ": " << profile << dendl;