Whamcloud - gitweb
LU-8066 obdclass: report all obd states for OBD_IOC_GETDEVICE 74/33774/5
authorJames Simmons <uja.ornl@yahoo.com>
Thu, 6 Dec 2018 16:19:59 +0000 (11:19 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 4 Jan 2019 04:46:30 +0000 (04:46 +0000)
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 <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33774
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/class_obd.c

index d408915..e20723f 100644 (file)
@@ -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,