summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5bd666d)
In copy_and_ioctl() use the kernel space copy as the karg to
obd_iocontrol().
Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I9b714675b4b63737efc08eec1b08463de1d63d1b
Reviewed-on: http://review.whamcloud.com/6274
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
-static int copy_and_ioctl(int cmd, struct obd_export *exp, void *data, int len)
+static int copy_and_ioctl(int cmd, struct obd_export *exp,
+ const void __user *data, size_t size)
- OBD_ALLOC(ptr, len);
- if (ptr == NULL)
- return -ENOMEM;
- if (copy_from_user(ptr, data, len)) {
- OBD_FREE(ptr, len);
- return -EFAULT;
- }
- rc = obd_iocontrol(cmd, exp, len, data, NULL);
- OBD_FREE(ptr, len);
- return rc;
+ OBD_ALLOC(copy, size);
+ if (copy == NULL)
+ return -ENOMEM;
+
+ if (copy_from_user(copy, data, size)) {
+ rc = -EFAULT;
+ goto out;
+ }
+
+ rc = obd_iocontrol(cmd, exp, size, copy, NULL);
+out:
+ OBD_FREE(copy, size);
+
+ return rc;
}
static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)
}
static int quotactl_ioctl(struct ll_sb_info *sbi, struct if_quotactl *qctl)