From: Theodore Ts'o Date: Fri, 6 Sep 2002 14:14:12 +0000 (-0400) Subject: rehash.c (copy_dir_entries): Fix bug which caused corrupted X-Git-Tag: E2FSPROGS-1_29~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=cf3909edfe0cd9680da51a4a547f6e7318cb944c;p=tools%2Fe2fsprogs.git 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. --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 7833872..744c95b 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2002-09-06 Theodore Ts'o + + * 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 * Release of E2fsprogs 1.28 diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index 2c64ec4..4ceb3e5 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -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; }