Merge branch 'for-5.11/elecom' into for-linus
[linux-2.6-microblaze.git] / mm / madvise.c
index 416a56b..a8d8d48 100644 (file)
@@ -226,7 +226,7 @@ static void force_shm_swapin_readahead(struct vm_area_struct *vma,
                struct address_space *mapping)
 {
        XA_STATE(xas, &mapping->i_pages, linear_page_index(vma, start));
-       pgoff_t end_index = end / PAGE_SIZE;
+       pgoff_t end_index = linear_page_index(vma, end + PAGE_SIZE - 1);
        struct page *page;
 
        rcu_read_lock();
@@ -1231,8 +1231,6 @@ SYSCALL_DEFINE5(process_madvise, int, pidfd, const struct iovec __user *, vec,
                ret = total_len - iov_iter_count(&iter);
 
        mmput(mm);
-       return ret;
-
 release_task:
        put_task_struct(task);
 put_pid: