nbd: Respect max_part for all partition scans
[linux-2.6-microblaze.git] / mm / process_vm_access.c
index fd12da8..4bcc119 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (C) 2010-2011 Christopher Yeoh <cyeoh@au1.ibm.com>, IBM Corp.
  */
 
+#include <linux/compat.h>
 #include <linux/mm.h>
 #include <linux/uio.h>
 #include <linux/sched.h>
@@ -259,7 +260,7 @@ static ssize_t process_vm_rw(pid_t pid,
        struct iovec iovstack_l[UIO_FASTIOV];
        struct iovec iovstack_r[UIO_FASTIOV];
        struct iovec *iov_l = iovstack_l;
-       struct iovec *iov_r = iovstack_r;
+       struct iovec *iov_r;
        struct iov_iter iter;
        ssize_t rc;
        int dir = vm_write ? WRITE : READ;
@@ -273,7 +274,8 @@ static ssize_t process_vm_rw(pid_t pid,
                return rc;
        if (!iov_iter_count(&iter))
                goto free_iov_l;
-       iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r, false);
+       iov_r = iovec_from_user(rvec, riovcnt, UIO_FASTIOV, iovstack_r,
+                               in_compat_syscall());
        if (IS_ERR(iov_r)) {
                rc = PTR_ERR(iov_r);
                goto free_iov_l;