Whamcloud - gitweb
Allow the journal size to up to 10,240,000 blocks
authorAndreas Dilger <adilger@clusterfs.com>
Sat, 7 Apr 2007 19:39:50 +0000 (15:39 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 7 Apr 2007 19:39:50 +0000 (15:39 -0400)
Increase the maximum size of the journal to 100 times the previous
maximum, but add a restriction that it can be no more than half the size
of the filesystem.

Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/ChangeLog
misc/util.c

index eff4f81..656b7df 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-07  Theodore Tso  <tytso@mit.edu>
+
+       * util.c (figure_journal_size): Allow the journal size to be up to
+               10,240,000 blocks, but no more half the size of the
+               filesystem.
+
 2007-04-02  Theodore Tso  <tytso@mit.edu>
 
        * badblocks.8.in: Document the -X flag.  
index 0ea6cb4..53f3613 100644 (file)
@@ -260,15 +260,15 @@ int figure_journal_size(int size, ext2_filsys fs)
        
        if (size > 0) {
                j_blocks = size * 1024 / (fs->blocksize / 1024);
-               if (j_blocks < 1024 || j_blocks > 102400) {
+               if (j_blocks < 1024 || j_blocks > 10240000) {
                        fprintf(stderr, _("\nThe requested journal "
                                "size is %d blocks; it must be\n"
-                               "between 1024 and 102400 blocks.  "
+                               "between 1024 and 10240000 blocks.  "
                                "Aborting.\n"),
                                j_blocks);
                        exit(1);
                }
-               if (j_blocks > fs->super->s_free_blocks_count) {
+               if (j_blocks > fs->super->s_free_blocks_count / 2) {
                        fputs(_("\nJournal size too big for filesystem.\n"),
                              stderr);
                        exit(1);