From: Amir Shehata Date: Tue, 28 Jul 2015 20:19:40 +0000 (-0700) Subject: LU-6542 lnet: handle cYAML out of memory error X-Git-Tag: 2.7.58~32 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ea229b9db1647e167f6c851154a102f1b6fc3fd6;p=fs%2Flustre-release.git LU-6542 lnet: handle cYAML out of memory error in cYAML_build_error() there is a potential on run out of memory scenario, that it is ignored and no error is built. In this case print out a properly formated YAML error message indicating fatal error Signed-off-by: Amir Shehata Change-Id: Id9159044acafb38bd022f421a997fa2d2f1841e8 Reviewed-on: http://review.whamcloud.com/15778 Tested-by: Jenkins Reviewed-by: John L. Hammond Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lnet/utils/cyaml/cyaml.c b/lnet/utils/cyaml/cyaml.c index 31283d8..6a12f8fb 100644 --- a/lnet/utils/cyaml/cyaml.c +++ b/lnet/utils/cyaml/cyaml.c @@ -1088,8 +1088,10 @@ void cYAML_build_error(int rc, int seq_no, char *cmd, return; failed: + /* Only reason we get here is if we run out of memory */ cYAML_free_tree(r); r = NULL; + fprintf(stderr, "error:\n\tfatal: out of memory\n"); } struct cYAML *cYAML_build_tree(char *yaml_file,