Whamcloud - gitweb
LU-874 ptlrpc: handle in-flight hqreq correctly
[fs/lustre-release.git] / lustre / ldlm / ldlm_extent.c
index fe730f5..9117142 100644 (file)
@@ -81,11 +81,12 @@ static void ldlm_extent_internal_policy_fixup(struct ldlm_lock *req,
         }
 
         /* we need to ensure that the lock extent is properly aligned to what
-         * the client requested.  We align it to the lowest-common denominator
-         * of the clients requested lock start and end alignment. */
-        mask = 0x1000ULL;
+         * the client requested. Also we need to make sure it's also server
+         * page size aligned otherwise a server page can be covered by two
+         * write locks. */
+        mask = CFS_PAGE_SIZE;
         req_align = (req_end + 1) | req_start;
-        if (req_align != 0) {
+        if (req_align != 0 && (req_align & (mask - 1)) == 0) {
                 while ((req_align & mask) == 0)
                         mask <<= 1;
         }