Whamcloud - gitweb
LU-6542 lnet: handle cYAML out of memory error 78/15778/3
authorAmir Shehata <amir.shehata@intel.com>
Tue, 28 Jul 2015 20:19:40 +0000 (13:19 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 3 Aug 2015 02:05:45 +0000 (02:05 +0000)
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 <amir.shehata@intel.com>
Change-Id: Id9159044acafb38bd022f421a997fa2d2f1841e8
Reviewed-on: http://review.whamcloud.com/15778
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/utils/cyaml/cyaml.c

index 31283d8..6a12f8f 100644 (file)
@@ -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,