If there exists MGS conf_param to reduce the memory cache
max_cached_mb it will fail because dt_exp is not initialized
yet.
It should just go ahead and configure it because certainly it
have enough free LRU slot to deduct ccc_lru_left.
This patch is back-ported from the following one:
Lustre-commit:
b0135d72b783eed4d9b86532be6244ebc57b1f39
Lustre-change: http://review.whamcloud.com/11783
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: If837f178592dd487775ddcb15115964fba6429bf
Reviewed-on: http://review.whamcloud.com/12924
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
/* Allow enough cache so clients can make well-formed RPCs */
pages_number = max_t(long, pages_number, PTLRPC_MAX_BRW_PAGES);
- if (sbi->ll_dt_exp == NULL) /* being initialized */
- GOTO(out, rc = 0);
-
spin_lock(&sbi->ll_lock);
diff = pages_number - cache->ccc_lru_max;
spin_unlock(&sbi->ll_lock);
if (diff <= 0)
break;
+ if (sbi->ll_dt_exp == NULL) { /* being initialized */
+ rc = -ENODEV;
+ break;
+ }
+
/* difficult - have to ask OSCs to drop LRU slots. */
tmp = diff << 1;
rc = obd_set_info_async(NULL, sbi->ll_dt_exp,