@@ -2114,9 +2114,7 @@ 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;
- case OBD_IOC_PING_TARGET:
- rc = ptlrpc_obd_ping(obd);
- goto out;
+
/*
* Normally IOC_OBD_STATFS, OBD_IOC_QUOTACTL iocontrol are handled by
* LMV instead of MDC. But when the cluster is upgraded from 1.8,
@@ -510,8 +510,8 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
static long obd_class_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
- /* Allow non-root access for OBD_IOC_PING_TARGET - used by lfs check */
- if (!capable(CAP_SYS_ADMIN) && (cmd != OBD_IOC_PING_TARGET))
+ /* Allow non-root access for some limited ioctls */
+ if (!capable(CAP_SYS_ADMIN))
return -EACCES;
if ((cmd & 0xffffff00) == ((int)'T') << 8) /* ignore all tty ioctls */
@@ -2840,7 +2840,7 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
{
struct obd_device *obd = exp->exp_obd;
struct obd_ioctl_data *data = karg;
- int err = 0;
+ int rc = 0;
if (!try_module_get(THIS_MODULE)) {
CERROR("%s: cannot get module '%s'\n", obd->obd_name,
@@ -2849,27 +2849,24 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
}
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;
+ rc = ptlrpc_recover_import(obd->u.cli.cl_import,
+ data->ioc_inlbuf1, 0);
+ if (rc > 0)
+ rc = 0;
goto out;
case IOC_OSC_SET_ACTIVE:
- err = ptlrpc_set_import_active(obd->u.cli.cl_import,
- data->ioc_offset);
- goto out;
- case OBD_IOC_PING_TARGET:
- err = ptlrpc_obd_ping(obd);
+ rc = ptlrpc_set_import_active(obd->u.cli.cl_import,
+ data->ioc_offset);
goto out;
default:
- CDEBUG(D_INODE, "unrecognised ioctl %#x by %s\n",
- cmd, current->comm);
- err = -ENOTTY;
+ CDEBUG(D_INODE, "%s: unrecognised ioctl %#x by %s\n",
+ obd->obd_name, cmd, current->comm);
+ rc = -ENOTTY;
goto out;
}
out:
module_put(THIS_MODULE);
- return err;
+ return rc;
}
int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
@@ -162,7 +162,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)