Storing hash 0 at same as hash 1 should be okay, don't ASSERT in this
case.
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I9b9488e5374d22dcfc9e7f2c969da3b02778097a
Reviewed-on: http://review.whamcloud.com/8821
Tested-by: Jenkins
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
{
if (BITS_PER_LONG == 32 && hash64)
hash >>= 32;
{
if (BITS_PER_LONG == 32 && hash64)
hash >>= 32;
- /* save hash 0 as index 0 because otherwise we'll save it at
- * page index end (~0UL) and it causes truncate_inode_pages_range()
- * to loop forever. */
+ /* save hash 0 with hash 1 */
return ~0ULL - (hash + !hash);
}
#endif
return ~0ULL - (hash + !hash);
}
#endif
if (BITS_PER_LONG == 32 && hash64)
hash >>= 32;
#endif
if (BITS_PER_LONG == 32 && hash64)
hash >>= 32;
#endif
- /* save hash 0 as index 0 because otherwise we'll save it at
- * page index end (~0UL) and it causes truncate_inode_pages_range()
- * to loop forever.
- */
+ /* save hash 0 with hash 1 */
return ~0UL - (hash + !hash);
}
return ~0UL - (hash + !hash);
}
*start = le64_to_cpu(dp->ldp_hash_start);
*end = le64_to_cpu(dp->ldp_hash_end);
}
*start = le64_to_cpu(dp->ldp_hash_start);
*end = le64_to_cpu(dp->ldp_hash_end);
}
- LASSERTF(*start <= *hash, "start = "LPX64",end = "
- LPX64",hash = "LPX64"\n", *start, *end, *hash);
+ if (unlikely(*start == 1 && *hash == 0))
+ *hash = *start;
+ else
+ LASSERTF(*start <= *hash, "start = "LPX64
+ ",end = "LPX64",hash = "LPX64"\n",
+ *start, *end, *hash);
CDEBUG(D_VFSTRACE, "page%lu [%llu %llu], hash"LPU64"\n",
offset, *start, *end, *hash);
if (*hash > *end) {
CDEBUG(D_VFSTRACE, "page%lu [%llu %llu], hash"LPU64"\n",
offset, *start, *end, *hash);
if (*hash > *end) {