diff options
author | Theodore Ts'o <tytso@mit.edu> | 2008-08-25 21:08:19 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2008-08-25 21:08:19 -0400 |
commit | 5dd77dbe5a0ac6d78c1c6441fae4087be56d9088 (patch) | |
tree | bb81c9f0ac2480836564a185fc0695cce4e65d5c /misc/e2image.c | |
parent | 649bd289d016e4d6db07318145ba488bf7095248 (diff) | |
download | e2fsprogs-5dd77dbe5a0ac6d78c1c6441fae4087be56d9088.tar.gz |
Add support for with empty directory blocks in 64k blocksize filesystems
The rec_len field in the directory entry is 16 bits, so if the
filesystem is completely empty, rec_len of 0 is used to designate
65536, for the case where the directory entry takes the entire 64k
block.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/e2image.c')
-rw-r--r-- | misc/e2image.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/misc/e2image.c b/misc/e2image.c index 081c66f7..358b3614 100644 --- a/misc/e2image.c +++ b/misc/e2image.c @@ -350,6 +350,8 @@ static void scramble_dir_block(ext2_filsys fs, blk_t blk, char *buf) #ifdef WORDS_BIGENDIAN rec_len = ext2fs_swab16(rec_len); #endif + rec_len = (rec_len || fs->blocksize < 65536) ? + rec_len : 65536; #if 0 printf("rec_len = %d, name_len = %d\n", rec_len, dirent->name_len); #endif |