OSDN Git Service

ChangeLog, initialize.c:
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 May 1998 05:32:18 +0000 (05:32 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 May 1998 05:32:18 +0000 (05:32 +0000)
  initialize.c (ext2fs_initialize): Initialize s_inodes_count in a way
  that avoids overflows on disk sizes greater than 4GB.

lib/ext2fs/ChangeLog
lib/ext2fs/initialize.c

index 80e054a..74ed690 100644 (file)
@@ -1,3 +1,8 @@
+1998-05-01  Theodore Ts'o  <tytso@rsts-11.mit.edu>
+
+       * initialize.c (ext2fs_initialize): Initialize s_inodes_count in a
+               way that avoids overflows on disk sizes greater than 4GB.
+
 1998-04-28  Theodore Ts'o  <tytso@rsts-11.mit.edu>
 
        * ext2fs.h: Define EXT2_QSORT_TYPE appropriately for the
index ebc41e6..c97a5bb 100644 (file)
@@ -157,7 +157,8 @@ retry:
                           EXT2_DESC_PER_BLOCK(super) - 1)
                / EXT2_DESC_PER_BLOCK(super);
 
-       set_field(s_inodes_count, (super->s_blocks_count*fs->blocksize)/4096);
+       /* n.b., fs->blocksize is <= 4096 */
+       set_field(s_inodes_count, super->s_blocks_count/(4096/fs->blocksize));
 
        /*
         * There should be at least as many inodes as the user