Merge tag 'nfs-for-5.9-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[linux-2.6-microblaze.git] / mm / madvise.c
index dd1d43c..d4aa5f7 100644 (file)
@@ -289,9 +289,9 @@ static long madvise_willneed(struct vm_area_struct *vma,
         */
        *prev = NULL;   /* tell sys_madvise we drop mmap_lock */
        get_file(file);
-       mmap_read_unlock(current->mm);
        offset = (loff_t)(start - vma->vm_start)
                        + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);
+       mmap_read_unlock(current->mm);
        vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED);
        fput(file);
        mmap_read_lock(current->mm);