[PATCH 09/26] staging/lustre/llite: error setting max_cache_mb at mount time

Peng Tao
2013-11-14T16:49:26Z

From: Jinshan Xiong <jinshan.xiong@intel.com>

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.

Lustre-change: http://review.whamcloud.com/7194
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3676
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c
index 18a5998c..17d3911 100644
--- a/drivers/staging/lustre/lustre/llite/lproc_llite.c
+++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c
@@ -393,8 +393,8 @@ static ssize_t ll_max_cached_mb_seq_write(struct file *file, const char *buffer,
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;
--
1.7.9.5