- info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
- erange = &info->fti_lrange;
-
- /* Lookup it in the cache. */
- rc = fld_cache_lookup(fld->lsf_cache, seq, erange);
- if (rc == 0) {
- if (unlikely(erange->lsr_flags != range->lsr_flags) &&
- range->lsr_flags != -1) {
- CERROR("FLD cache found a range "DRANGE" doesn't "
- "match the requested flag %x\n",
- PRANGE(erange), range->lsr_flags);
- RETURN(-EIO);
- }
- *range = *erange;
- RETURN(0);
- }
+ info = lu_context_key_get(&env->le_ctx, &fld_thread_key);
+ LASSERT(info != NULL);
+ erange = &info->fti_lrange;
+
+ /* Lookup it in the cache. */
+ rc = fld_cache_lookup(fld->lsf_cache, seq, erange);
+ if (rc == 0) {
+ if (unlikely(fld_range_type(erange) != fld_range_type(range) &&
+ !fld_range_is_any(range))) {
+ CERROR("%s: FLD cache range "DRANGE" does not match"
+ "requested flag %x: rc = %d\n", fld->lsf_name,
+ PRANGE(erange), range->lsr_flags, -EIO);
+ RETURN(-EIO);
+ }
+ *range = *erange;
+ RETURN(0);
+ }