Commit b0337d6c authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging/lustre/llite: pass correct pointer to obd_iocontrol()

In copy_and_ioctl() use the kernel space copy as the karg to
obd_iocontrol().

Lustre-change: http://review.whamcloud.com/6274
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3283Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarSebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarPeng Tao <bergwolf@gmail.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f2fb455
...@@ -1048,20 +1048,25 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy) ...@@ -1048,20 +1048,25 @@ static int ll_ioc_copy_end(struct super_block *sb, struct hsm_copy *copy)
} }
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)
{ {
void *ptr; void *copy;
int rc; int rc;
OBD_ALLOC(ptr, len); OBD_ALLOC(copy, size);
if (ptr == NULL) if (copy == NULL)
return -ENOMEM; return -ENOMEM;
if (copy_from_user(ptr, data, len)) {
OBD_FREE(ptr, len); if (copy_from_user(copy, data, size)) {
return -EFAULT; rc = -EFAULT;
goto out;
} }
rc = obd_iocontrol(cmd, exp, len, data, NULL);
OBD_FREE(ptr, len); rc = obd_iocontrol(cmd, exp, size, copy, NULL);
out:
OBD_FREE(copy, size);
return rc; return rc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment