From adfec49f334daf244b82007971f445e923051062 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Thu, 6 Dec 2018 11:19:59 -0500 Subject: [PATCH] LU-8066 obdclass: report all obd states for OBD_IOC_GETDEVICE The wrong state '--' which is reported when the obd device is inactive. Reporting the "IN" state cover all the information that is provided by 'devices' debugfs file. Now all the information from 'devices' can be collected from the lustre sysfs tree. Change-Id: I2479b15578babeb6f45da8129ffc0de99044730a Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/33774 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Ben Evans Reviewed-by: Andreas Dilger --- lustre/obdclass/class_obd.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index d408915..e20723f 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -429,14 +429,17 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) if (!obd) GOTO(out, err = -ENOENT); - if (obd->obd_stopping) - status = "ST"; - else if (obd->obd_set_up) - status = "UP"; - else if (obd->obd_attached) - status = "AT"; - else - status = "--"; + if (obd->obd_stopping) + status = "ST"; + else if (obd->obd_inactive) + status = "IN"; + else if (obd->obd_set_up) + status = "UP"; + else if (obd->obd_attached) + status = "AT"; + else + status = "--"; + str = (char *)data->ioc_bulk; snprintf(str, len - sizeof(*data), "%3d %s %s %s %s %d", (int)index, status, obd->obd_type->typ_name, -- 1.8.3.1