Whamcloud - gitweb
LU-3676 llite: to configure max_cached_mb correctly 24/12924/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 3 Dec 2014 22:59:04 +0000 (14:59 -0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 Jan 2015 04:44:51 +0000 (04:44 +0000)
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>
lustre/llite/lproc_llite.c

index 86d8119..ef65f54 100644 (file)
@@ -448,9 +448,6 @@ static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
        /* 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);
@@ -485,6 +482,11 @@ static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
                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,