[PATCH] e2fsck: fix endianness problem when reading htree nodes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wrong directory block number can be saved in ->previous on big endian
system in parse_int_node(). Fix it by moving the mask out of the endian
conversion.

Fixes: ae9efd05a986 ("e2fsck: 3 level hash tree directory optimization")
Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx>
---
 e2fsck/pass2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 1b0504c..345b29e 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -664,7 +664,7 @@ static void parse_int_node(ext2_filsys fs,
 		}
 
 		dx_db->previous =
-			i ? ext2fs_le32_to_cpu(ent[i-1].block & 0x0ffffff) : 0;
+			i ? ext2fs_le32_to_cpu(ent[i-1].block) & 0x0ffffff : 0;
 
 		if (hash < min_hash)
 			min_hash = hash;
-- 
2.7.5




[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux