Whamcloud - gitweb
LU-8017 obd: report correct health state of a node 37/19537/3
authorJames Simmons <uja.ornl@yahoo.com>
Fri, 29 Apr 2016 16:47:38 +0000 (12:47 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 8 May 2016 17:40:26 +0000 (17:40 +0000)
The patch 16933 that changed the handling of seq_printf
to work with newer kernels introduced a bug in the proc
file that reports the health of a node. The original
code returned immediately after a healthy state was
reported but the bug prevented the immediate return
so a false unhealthy state was always reported instead.

Change-Id: I414d43d59f0df413ea955acf74c91d2402543228
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/19537
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/obdclass/linux/linux-module.c
lustre/tests/test-framework.sh

index c4c556d..e0a54c5 100644 (file)
@@ -277,8 +277,8 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *data)
 
        if (healthy)
                seq_puts(m, "healthy\n");
-
-       seq_printf(m, "NOT HEALTHY\n");
+       else
+               seq_puts(m, "NOT HEALTHY\n");
        return 0;
 }
 LPROC_SEQ_FOPS_RO(obd_proc_health);
index c713d66..098a563 100755 (executable)
@@ -1276,6 +1276,11 @@ mount_facet() {
                return $RC
        fi
 
+       health=$(do_facet ${facet} "$LCTL get_param -n health_check")
+       if [[ "$health" != "healthy" ]]; then
+               error "$facet is in a unhealthy state"
+       fi
+
        set_default_debug_facet $facet
 
        if [[ $facet == mds* ]]; then