Whamcloud - gitweb
LU-3676 llite: error setting max_cache_mb at mount time 94/7194/4
authorJinshan Xiong <jinshan.xiong@intel.com>
Wed, 31 Jul 2013 19:31:27 +0000 (12:31 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 17 Sep 2013 08:23:22 +0000 (08:23 +0000)
The root cause is that when max_cache_mb conf parameter is applied,
the client isn't connected to the OST yet so that sbi->ll_dt_exp is
NULL. However, it's not necessary to shrink the cache memory in this
case so success should be returned.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ib12800812b635207bf4001e2272aadb0ce1e0d6f
Reviewed-on: http://review.whamcloud.com/7194
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre/llite/lproc_llite.c

index 2dae8b5..4b86d48 100644 (file)
@@ -446,8 +446,8 @@ static int ll_wr_max_cached_mb(struct file *file, const char *buffer,
                RETURN(-ERANGE);
        }
 
                RETURN(-ERANGE);
        }
 
-       if (sbi->ll_dt_exp == NULL)
-               RETURN(-ENODEV);
+       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_lock(&sbi->ll_lock);
        diff = pages_number - cache->ccc_lru_max;