From: James Simmons Date: Fri, 29 Apr 2016 16:47:38 +0000 (-0400) Subject: LU-8017 obd: report correct health state of a node X-Git-Tag: 2.8.53~5 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c28933602a6971739cb5ec3a1e920409ff19b01e LU-8017 obd: report correct health state of a node 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 Reviewed-on: http://review.whamcloud.com/19537 Reviewed-by: Andreas Dilger Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Frank Zago Reviewed-by: John L. Hammond --- diff --git a/lustre/obdclass/linux/linux-module.c b/lustre/obdclass/linux/linux-module.c index c4c556d..e0a54c5 100644 --- a/lustre/obdclass/linux/linux-module.c +++ b/lustre/obdclass/linux/linux-module.c @@ -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); diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index c713d66..098a563 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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