Wrapfs: mmap fixes. fault/mkwrite do not take vma param any longer.
authorErez Zadok <ezk@cs.sunysb.edu>
Sun, 3 Feb 2019 22:54:47 +0000 (17:54 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 3 Feb 2019 22:54:47 +0000 (17:54 -0500)
fs/wrapfs/mmap.c

index 419c403e2c69b1ab87426d5ca0d2d67885d53c34..9b1578c0ffdfac135568a8fe56aab0bb24cc3def 100644 (file)
@@ -36,7 +36,9 @@ static int wrapfs_fault(struct vm_fault *vmf)
         * take an explicit file pointer.
         */
        lower_vma.vm_file = lower_file;
+       vmf->vma = &lower_vma; /* override vma temporarily */
        err = lower_vm_ops->fault(vmf);
+       vmf->vma = vma; /* restore vma*/
        return err;
 }
 
@@ -68,7 +70,9 @@ static int wrapfs_page_mkwrite(struct vm_fault *vmf)
         * ->page_mkwrite to take an explicit file pointer.
         */
        lower_vma.vm_file = lower_file;
+       vmf->vma = &lower_vma; /* override vma temporarily */
        err = lower_vm_ops->page_mkwrite(vmf);
+       vmf->vma = vma; /* restore vma */
 out:
        return err;
 }