Whamcloud - gitweb
Fix fencepost error in allocating space for array.
authorTheodore Ts'o <tytso@mit.edu>
Sat, 18 May 2002 03:37:42 +0000 (23:37 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 18 May 2002 03:37:42 +0000 (23:37 -0400)
e2fsck/pass1.c

index 8e04846..d252bb7 100644 (file)
@@ -103,7 +103,8 @@ struct scan_callback_struct {
 static struct process_inode_block *inodes_to_process;
 static int process_inode_count;
 
-static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE - EXT2_MIN_BLOCK_LOG_SIZE];
+static __u64 ext2_max_sizes[EXT2_MAX_BLOCK_LOG_SIZE -
+                           EXT2_MIN_BLOCK_LOG_SIZE + 1];
 
 /*
  * Free all memory allocated by pass1 in preparation for restarting
@@ -273,7 +274,7 @@ void e2fsck_pass1(e2fsck_t ctx)
                max_sizes = max_sizes + EXT2_BPP(i) * EXT2_BPP(i);
                max_sizes = max_sizes + EXT2_BPP(i) * EXT2_BPP(i) * EXT2_BPP(i);
                max_sizes = (max_sizes * (1UL << i)) - 1;
-               ext2_max_sizes[i - 10] = max_sizes;
+               ext2_max_sizes[i - EXT2_MIN_BLOCK_LOG_SIZE] = max_sizes;
        }
 #undef EXT2_BPP