summaryrefslogtreecommitdiff
path: root/lib/ext2fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-12-22 13:53:02 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-12-22 13:53:02 -0500
commita4fdf09414e04e9ecb995aa0af2f525d335987ae (patch)
treecfe7058bcb05a10e62f0520102990e6584078ae9 /lib/ext2fs
parent9098c986b64bb65a2b7fcd2724a400ba1f451f6b (diff)
downloade2fsprogs-a4fdf09414e04e9ecb995aa0af2f525d335987ae.tar.gz
libext2fs: Don't use the extended rec_len encoding for standard file systems
If the file system has a blocksize less than 64k, then don't use the extended rec_len encoding, to be consistent with what the kernel will do. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'lib/ext2fs')
-rw-r--r--lib/ext2fs/dir_iterate.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 3b9c57c4..124862ea 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c
@@ -29,7 +29,9 @@ errcode_t ext2fs_get_rec_len(ext2_filsys fs,
{
unsigned int len = dirent->rec_len;
- if (len == EXT4_MAX_REC_LEN || len == 0)
+ if (fs->blocksize < 65536)
+ *rec_len = len;
+ else if (len == EXT4_MAX_REC_LEN || len == 0)
*rec_len = fs->blocksize;
else
*rec_len = (len & 65532) | ((len & 3) << 16);