Whamcloud - gitweb
rehash.c (copy_dir_entries): Fix bug which caused corrupted
authorTheodore Ts'o <tytso@mit.edu>
Fri, 6 Sep 2002 14:14:12 +0000 (10:14 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 6 Sep 2002 14:14:12 +0000 (10:14 -0400)
directories if there are 4 or 8 bytes left over in a
directory page when optimizing/reindexing a directory.

e2fsck/ChangeLog
e2fsck/rehash.c

index 7833872..744c95b 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-06  Theodore Ts'o  <tytso@mit.edu>
+
+       * rehash.c (copy_dir_entries): Fix bug which caused corrupted
+               directories if there are 4 or 8 bytes left over in a
+               directory page when optimizing/reindexing a directory.
+
 2001-08-31  Theodore Tso  <tytso@thunk.org>
 
        * Release of E2fsprogs 1.28
index 2c64ec4..4ceb3e5 100644 (file)
@@ -309,6 +309,7 @@ static errcode_t copy_dir_entries(ext2_filsys fs,
                if (left < 12) {
                        dirent->rec_len += left;
                        offset += left;
+                       left = 0;
                }
                prev_hash = ent->hash;
        }