Whamcloud - gitweb
mkfs_lustre: return journal size limit back: buffalo tests fail without this.
authornikita <nikita>
Wed, 8 Nov 2006 13:01:50 +0000 (13:01 +0000)
committernikita <nikita>
Wed, 8 Nov 2006 13:01:50 +0000 (13:01 +0000)
lustre/utils/mkfs_lustre.c

index 50a649c..c4b937c 100644 (file)
@@ -448,9 +448,13 @@ int make_lustre_backfs(struct mkfs_opts *mop)
                 /* Journal size in MB */
                 if (strstr(mop->mo_mkfsopts, "-J") == NULL) {
                         /* Choose our own default journal size */
-                        long journal_sz = 0;
+                        long journal_sz = 0, max_sz;
                         if (device_sz > 1024 * 1024) /* 1GB */
                                 journal_sz = (device_sz / 102400) * 4;
+                        /* man mkfs.ext3 */
+                        max_sz = (102400 * L_BLOCK_SIZE) >> 20; /* 400MB */
+                        if (journal_sz > max_sz)
+                                journal_sz = max_sz;
                         if (journal_sz) {
                                 sprintf(buf, " -J size=%ld", journal_sz);
                                 strcat(mop->mo_mkfsopts, buf);