public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Carlos Maiolino <cmaiolino@redhat.com>
To: linux-ext4@vger.kernel.org
Subject: [PATCH] ext2: Make sb magic number endianness conversion consistent
Date: Thu, 17 Oct 2013 14:24:58 -0300	[thread overview]
Message-ID: <1382030698-8746-1-git-send-email-cmaiolino@redhat.com> (raw)

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


             reply	other threads:[~2013-10-17 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-17 17:24 Carlos Maiolino [this message]
2013-10-17 17:50 ` [PATCH] ext2: Make sb magic number endianness conversion consistent Lukáš Czerner
2013-10-17 17:59   ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1382030698-8746-1-git-send-email-cmaiolino@redhat.com \
    --to=cmaiolino@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox