]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
libext2fs: Don't use the extended rec_len encoding for standard file systems
authorTheodore Ts'o <tytso@mit.edu>
Wed, 22 Dec 2010 18:53:02 +0000 (13:53 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 22 Dec 2010 18:53:02 +0000 (13:53 -0500)
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>
lib/ext2fs/dir_iterate.c
tests/f_dup3/expect.1
tests/f_dupfsblks/expect.1

index 3b9c57c49bba55bf03c934c7020459431494a497..124862ea1f87469ebcb1d7b9221fd2ef5bf017c9 100644 (file)
@@ -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);
index 9b1a28fa4ed667dc617f1ada53731ef21a8a8ed5..eab75a8dc8b4fc774b23b64d8beab882811c3d4a 100644 (file)
@@ -24,8 +24,8 @@ File /e2fsck (inode #16, mod time Tue Sep 21 04:32:22 1993)
 Clone multiply-claimed blocks? yes
 
 Pass 2: Checking directory structure
-Entry '' in /lost+found (11) has invalid inode #: 24.
-Clear? yes
+Directory inode 11, block #12, offset 0: directory corrupted
+Salvage? yes
 
 Pass 3: Checking directory connectivity
 Pass 4: Checking reference counts
index aba2f52374c8c151860ca635cecdfe42f4b4e9df..3f70109128e6b847fad2a456c4a6d3184e30b984 100644 (file)
@@ -35,11 +35,14 @@ File /quux (inode #14, mod time Thu Aug  5 07:18:09 1999)
 Clone multiply-claimed blocks? yes
 
 Pass 2: Checking directory structure
-Entry '' in ??? (12) has invalid inode #: 4194303.
-Clear? yes
+Directory inode 12, block #1, offset 0: direct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-^?M-^?M-^?M-^?M-^?' in ??? (12) has invalid inode #: 16383.
-Clear? yes
+Directory inode 12, block #2, offset 0: directory corrupted
+Salvage? yes
+
+Directory inode 12, block #3, offset 0: directory corrupted
+Salvage? yes
 
 Entry '' in ??? (12) has a zero-length name.
 Clear? yes