From: Andreas Dilger Date: Tue, 20 Nov 2018 21:24:22 +0000 (-0700) Subject: LU-6202 misc: delete OBD_IOC_PING_TARGET ioctl X-Git-Tag: 2.12.53~81 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=d17d6ef74e522a4b57f2824161788a69f32bd5e7 LU-6202 misc: delete OBD_IOC_PING_TARGET ioctl 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 Change-Id: I7e4881edc50526e28b1a1aa039a4c986593ebbe5 Reviewed-on: https://review.whamcloud.com/33691 Tested-by: Jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/uapi/linux/lustre/lustre_ioctl.h b/lustre/include/uapi/linux/lustre/lustre_ioctl.h index 1cac793..0fc3a02 100644 --- a/lustre/include/uapi/linux/lustre/lustre_ioctl.h +++ b/lustre/include/uapi/linux/lustre/lustre_ioctl.h @@ -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) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 0805643..8e85aeb 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -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, diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index e20723f..431a42d 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -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 */ diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a8c0e5c..29a3c16 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -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, diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index cb475de..c8133f1 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -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());