Whamcloud - gitweb
LU-176 obdclass: disable mb_cache by default
authorLiang Zhen <liang@whamcloud.com>
Tue, 29 Mar 2011 03:37:28 +0000 (11:37 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Jan 2012 18:44:08 +0000 (13:44 -0500)
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 <liang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/373
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/obd_mount.c

index 6e18246..8c50cfb 100644 (file)
@@ -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);
         }