Merge tag 'perf-tools-for-v6.1-1-2022-10-07' of git://git.kernel.org/pub/scm/linux...
[linux-block.git] / lib / iov_iter.c
index 4b7fce72e3e521348851c56f4a6335f8728c07b4..c3ca28ca68a65d70865d19accea5f07a9ff39b4b 100644 (file)
@@ -174,13 +174,16 @@ static int copyout(void __user *to, const void *from, size_t n)
 
 static int copyin(void *to, const void __user *from, size_t n)
 {
+       size_t res = n;
+
        if (should_fail_usercopy())
                return n;
        if (access_ok(from, n)) {
-               instrument_copy_from_user(to, from, n);
-               n = raw_copy_from_user(to, from, n);
+               instrument_copy_from_user_before(to, from, n);
+               res = raw_copy_from_user(to, from, n);
+               instrument_copy_from_user_after(to, from, n, res);
        }
-       return n;
+       return res;
 }
 
 static inline struct pipe_buffer *pipe_buf(const struct pipe_inode_info *pipe,