Whamcloud - gitweb
LU-7623 lov: Get rid of an ugly statfs hack in lov_iocontrol
[fs/lustre-release.git] / lustre / lov / lov_obd.c
index d3b3a6c..7c00acf 100644 (file)
@@ -1096,7 +1096,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                 __u32 index;
                __u32 flags;
 
-                memcpy(&index, data->ioc_inlbuf2, sizeof(__u32));
+                memcpy(&index, data->ioc_inlbuf2, sizeof(index));
                 if ((index >= count))
                         RETURN(-ENODEV);
 
@@ -1116,7 +1116,9 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
                                       sizeof(struct obd_uuid))))
                        RETURN(-EFAULT);
 
-               flags = uarg ? *(__u32 __user *)uarg : 0;
+               memcpy(&flags, data->ioc_inlbuf1, sizeof(flags));
+               flags = flags & LL_STATFS_NODELAY ? OBD_STATFS_NODELAY : 0;
+
                 /* got statfs data */
                 rc = obd_statfs(NULL, lov->lov_tgts[index]->ltd_exp, &stat_buf,
                                 cfs_time_shift_64(-OBD_STATFS_CACHE_SECONDS),