[PATCH] ext2: Make sb magic number endianness conversion consistent

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

 



All ext2_super_block fields are converted from le16 to cpu when checked or
loaded into memory. Magic number check is the only field where we convert the
magic number to le16. So, make the conversion pattern consistent with the
remaining code

Signed-off-by: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
---
 fs/ext2/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 2885349..808f99f 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -927,7 +927,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 		}
 		es = (struct ext2_super_block *) (((char *)bh->b_data) + offset);
 		sbi->s_es = es;
-		if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) {
+		if (le16_to_cpu(es->s_magic) != EXT2_SUPER_MAGIC) {
 			ext2_msg(sb, KERN_ERR, "error: magic mismatch");
 			goto failed_mount;
 		}
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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