Whamcloud - gitweb
LU-1118 llite: Invoke file_update_time in page_mkwrite
[fs/lustre-release.git] / lustre / llite / llite_mmap.c
index e7f57d6..7d7177c 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 
 static const struct vm_operations_struct ll_file_vm_ops;
 
-void policy_from_vma(ldlm_policy_data_t *policy,
-                            struct vm_area_struct *vma, unsigned long addr,
-                            size_t count)
+void policy_from_vma(union ldlm_policy_data *policy, struct vm_area_struct *vma,
+                    unsigned long addr, size_t count)
 {
        policy->l_extent.start = ((addr - vma->vm_start) & PAGE_MASK) +
                                 (vma->vm_pgoff << PAGE_CACHE_SHIFT);
-        policy->l_extent.end = (policy->l_extent.start + count - 1) |
+       policy->l_extent.end = (policy->l_extent.start + count - 1) |
                               ~PAGE_MASK;
 }
 
@@ -128,6 +127,7 @@ ll_fault_io_init(struct vm_area_struct *vma, struct lu_env **env_ret,
 
         *env_ret = env;
 
+restart:
        io = vvp_env_thread_io(env);
         io->ci_obj = ll_i2info(inode)->lli_clob;
         LASSERT(io->ci_obj != NULL);
@@ -163,11 +163,14 @@ ll_fault_io_init(struct vm_area_struct *vma, struct lu_env **env_ret,
        } else {
                LASSERT(rc < 0);
                cl_io_fini(env, io);
+               if (io->ci_need_restart)
+                       goto restart;
+
                cl_env_nested_put(nest, env);
                io = ERR_PTR(rc);
        }
 
-       return io;
+       RETURN(io);
 }
 
 /* Sharing code of page_mkwrite method for rhel5 and rhel6 */
@@ -391,6 +394,7 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
         bool retry;
         int result;
 
+       file_update_time(vma->vm_file);
         do {
                 retry = false;
                 result = ll_page_mkwrite0(vma, vmf->page, &retry);