Whamcloud - gitweb
LU-5969 obdclass: deprecate OBD_GET_VERSION ioctl 40/26440/5
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 20 Jan 2015 09:51:20 +0000 (02:51 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 13 Jun 2017 16:54:33 +0000 (16:54 +0000)
Mark OBD_GET_VERSION ioctl deprecated, disable before 3.1 release.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I681a353e6f65fd1ec2d1434fe4a1fa55ed3ebbe5
Reviewed-on: https://review.whamcloud.com/26440
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/class_obd.c

index 17b0b9f..d65a85d 100644 (file)
@@ -257,7 +257,10 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
                 GOTO(out, err);
         }
 
                 GOTO(out, err);
         }
 
-       case OBD_GET_VERSION:
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(3, 0, 53, 0)
+       case OBD_GET_VERSION: {
+               static bool warned;
+
                if (!data->ioc_inlbuf1) {
                        CERROR("No buffer passed in ioctl\n");
                        GOTO(out, err = -EINVAL);
                if (!data->ioc_inlbuf1) {
                        CERROR("No buffer passed in ioctl\n");
                        GOTO(out, err = -EINVAL);
@@ -268,13 +271,20 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
                        GOTO(out, err = -EINVAL);
                }
 
                        GOTO(out, err = -EINVAL);
                }
 
+               if (!warned) {
+                       warned = true;
+                       CWARN("%s: ioctl(OBD_GET_VERSION) is deprecated, "
+                             "use llapi_get_version_string() and/or relink\n",
+                             current->comm);
+               }
                memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING,
                       strlen(LUSTRE_VERSION_STRING) + 1);
 
                if (copy_to_user((void __user *)arg, data, len))
                        err = -EFAULT;
                GOTO(out, err);
                memcpy(data->ioc_bulk, LUSTRE_VERSION_STRING,
                       strlen(LUSTRE_VERSION_STRING) + 1);
 
                if (copy_to_user((void __user *)arg, data, len))
                        err = -EFAULT;
                GOTO(out, err);
-
+       }
+#endif
         case OBD_IOC_NAME2DEV: {
                 /* Resolve a device name.  This does not change the
                  * currently selected device.
         case OBD_IOC_NAME2DEV: {
                 /* Resolve a device name.  This does not change the
                  * currently selected device.