}
/* 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;
}