From e9bd648f53ecc95eca67fa0ddaddec03053ad7f5 Mon Sep 17 00:00:00 2001 From: Liang Zhen Date: Tue, 29 Mar 2011 11:37:28 +0800 Subject: [PATCH] LU-176 obdclass: disable mb_cache by default We are supposed to disable mb_cache by default (bug 22771), but we never did because it's not in default mount option. This patch will add "no_mbcache" to default mount option. Change-Id: I13c9db8e98ad305d26d887d8bd069eff92c20763 Signed-off-by: Liang Zhen Reviewed-on: http://review.whamcloud.com/373 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- lustre/obdclass/obd_mount.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6e18246..8c50cfb 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -1409,6 +1409,7 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb) char *options = NULL; unsigned long page, s_flags; struct page *__page; + int len; int rc; ENTRY; @@ -1464,11 +1465,15 @@ static struct vfsmount *server_kernel_mount(struct super_block *sb) memset(options, 0, CFS_PAGE_SIZE); strncpy(options, ldd->ldd_mount_opts, CFS_PAGE_SIZE - 2); + len = CFS_PAGE_SIZE - strlen(options) - 2; + if (*options != 0) + strcat(options, ","); + strncat(options, "no_mbcache", len); + /* Add in any mount-line options */ if (lmd->lmd_opts && (*(lmd->lmd_opts) != 0)) { - int len = CFS_PAGE_SIZE - strlen(options) - 2; - if (*options != 0) - strcat(options, ","); + len = CFS_PAGE_SIZE - strlen(options) - 2; + strcat(options, ","); strncat(options, lmd->lmd_opts, len); } -- 1.8.3.1