public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ext2: Make sb magic number endianness conversion consistent
@ 2013-10-17 17:24 Carlos Maiolino
  2013-10-17 17:50 ` Lukáš Czerner
  0 siblings, 1 reply; 3+ messages in thread
From: Carlos Maiolino @ 2013-10-17 17:24 UTC (permalink / raw)
  To: linux-ext4

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@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-17 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-17 17:24 [PATCH] ext2: Make sb magic number endianness conversion consistent Carlos Maiolino
2013-10-17 17:50 ` Lukáš Czerner
2013-10-17 17:59   ` Carlos Maiolino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox