Whamcloud - gitweb
LU-6202 misc: delete OBD_IOC_PING_TARGET ioctl 91/33691/5
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 20 Nov 2018 21:24:22 +0000 (14:24 -0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 Apr 2019 07:23:43 +0000 (07:23 +0000)
The OBD_IOC_PING_TARGET ioctl was removed from tool usage in
Lustre v2_5_60_0-27-g122aadd and replaced with a /proc interface.
It is no longer needed and can be removed.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I7e4881edc50526e28b1a1aa039a4c986593ebbe5
Reviewed-on: https://review.whamcloud.com/33691
Tested-by: Jenkins
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_ioctl.h
lustre/mdc/mdc_request.c
lustre/obdclass/class_obd.c
lustre/osc/osc_request.c
lustre/osp/osp_dev.c

index 1cac793..0fc3a02 100644 (file)
@@ -177,7 +177,7 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data)
 #define OBD_IOC_GETDTNAME      OBD_IOC_GETNAME
 #define OBD_IOC_LOV_GET_CONFIG _IOWR('f', 132, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_CLIENT_RECOVER _IOW('f', 133, OBD_IOC_DATA_TYPE)
-#define OBD_IOC_PING_TARGET    _IOW('f', 136, OBD_IOC_DATA_TYPE)
+/* was OBD_IOC_PING_TARGET     _IOW('f', 136, OBD_IOC_DATA_TYPE) until 2.11 */
 
 /*     OBD_IOC_DEC_FS_USE_COUNT _IO('f', 139) */
 #define OBD_IOC_NO_TRANSNO     _IOW('f', 140, OBD_IOC_DATA_TYPE)
index 0805643..8e85aeb 100644 (file)
@@ -2103,9 +2103,6 @@ static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
        case IOC_OSC_SET_ACTIVE:
                rc = ptlrpc_set_import_active(imp, data->ioc_offset);
                GOTO(out, rc);
-       case OBD_IOC_PING_TARGET:
-               rc = ptlrpc_obd_ping(obd);
-               GOTO(out, rc);
        /*
         * Normally IOC_OBD_STATFS, OBD_IOC_QUOTACTL iocontrol are handled by
         * LMV instead of MDC. But when the cluster is upgraded from 1.8,
index e20723f..431a42d 100644 (file)
@@ -530,8 +530,8 @@ static long obd_class_ioctl(struct file *filp, unsigned int cmd,
        int err = 0;
 
        ENTRY;
-       /* Allow non-root access for OBD_IOC_PING_TARGET - used by lfs check */
-       if (!cfs_capable(CFS_CAP_SYS_ADMIN) && (cmd != OBD_IOC_PING_TARGET))
+       /* Allow non-root access for some limited ioctls */
+       if (!cfs_capable(CFS_CAP_SYS_ADMIN))
                RETURN(err = -EACCES);
 
        if ((cmd & 0xffffff00) == ((int)'T') << 8) /* ignore all tty ioctls */
index a8c0e5c..29a3c16 100644 (file)
@@ -2831,38 +2831,36 @@ out:
 static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                         void *karg, void __user *uarg)
 {
-        struct obd_device *obd = exp->exp_obd;
-        struct obd_ioctl_data *data = karg;
-        int err = 0;
-        ENTRY;
+       struct obd_device *obd = exp->exp_obd;
+       struct obd_ioctl_data *data = karg;
+       int rc = 0;
 
+       ENTRY;
        if (!try_module_get(THIS_MODULE)) {
                CERROR("%s: cannot get module '%s'\n", obd->obd_name,
                       module_name(THIS_MODULE));
                return -EINVAL;
        }
-        switch (cmd) {
-        case OBD_IOC_CLIENT_RECOVER:
-                err = ptlrpc_recover_import(obd->u.cli.cl_import,
-                                            data->ioc_inlbuf1, 0);
-                if (err > 0)
-                        err = 0;
-                GOTO(out, err);
-        case IOC_OSC_SET_ACTIVE:
-                err = ptlrpc_set_import_active(obd->u.cli.cl_import,
-                                               data->ioc_offset);
-                GOTO(out, err);
-        case OBD_IOC_PING_TARGET:
-                err = ptlrpc_obd_ping(obd);
-                GOTO(out, err);
+       switch (cmd) {
+       case OBD_IOC_CLIENT_RECOVER:
+               rc = ptlrpc_recover_import(obd->u.cli.cl_import,
+                                          data->ioc_inlbuf1, 0);
+               if (rc > 0)
+                       rc = 0;
+               break;
+       case IOC_OSC_SET_ACTIVE:
+               rc = ptlrpc_set_import_active(obd->u.cli.cl_import,
+                                             data->ioc_offset);
+               break;
        default:
-               CDEBUG(D_INODE, "unrecognised ioctl %#x by %s\n",
-                      cmd, current_comm());
-               GOTO(out, err = -ENOTTY);
+               rc = -ENOTTY;
+               CDEBUG(D_INODE, "%s: unrecognised ioctl %#x by %s: rc = %d\n",
+                      obd->obd_name, cmd, current_comm(), rc);
+               break;
        }
-out:
+
        module_put(THIS_MODULE);
-       return err;
+       return rc;
 }
 
 int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
index cb475de..c8133f1 100644 (file)
@@ -1679,9 +1679,6 @@ static int osp_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                rc = ptlrpc_set_import_active(obd->u.cli.cl_import,
                                              data->ioc_offset);
                break;
-       case OBD_IOC_PING_TARGET:
-               rc = ptlrpc_obd_ping(obd);
-               break;
        default:
                CERROR("%s: unrecognized ioctl %#x by %s\n", obd->obd_name,
                       cmd, current_comm());