linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: Anton Blanchard <anton@samba.org>,
	linuxppc-dev@ozlabs.org, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] fix logic error in AIX detection
Date: Thu, 4 Jan 2007 14:20:53 +0100	[thread overview]
Message-ID: <20070104132053.GA24903@suse.de> (raw)
In-Reply-To: <20070104084049.GA19959@suse.de>


Correct the AIX magic check to let 'echo > /dev/sdb' actually work.

Signed-off-by: Olaf Hering <olh@suse.de>

---
 fs/partitions/msdos.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Index: linux-2.6.20-rc3/fs/partitions/msdos.c
===================================================================
--- linux-2.6.20-rc3.orig/fs/partitions/msdos.c
+++ linux-2.6.20-rc3/fs/partitions/msdos.c
@@ -68,10 +68,10 @@ static int aix_magic_present(unsigned ch
 	unsigned char *d;
 	int slot, ret = 0;
 
-	if (p[0] != AIX_LABEL_MAGIC1 &&
-		p[1] != AIX_LABEL_MAGIC2 &&
-		p[2] != AIX_LABEL_MAGIC3 &&
-		p[3] != AIX_LABEL_MAGIC4)
+	if (!(p[0] == AIX_LABEL_MAGIC1 &&
+		p[1] == AIX_LABEL_MAGIC2 &&
+		p[2] == AIX_LABEL_MAGIC3 &&
+		p[3] == AIX_LABEL_MAGIC4))
 		return 0;
 	/* Assume the partition table is valid if Linux partitions exists */
 	for (slot = 1; slot <= 4; slot++, pt++) {

      reply	other threads:[~2007-01-04 13:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 21:16 2.6.19 cannot find root partition Anton Blanchard
2006-12-06 21:24 ` Olaf Hering
2006-12-06 22:22 ` David Gibson
2006-12-07  8:17   ` Olaf Hering
2007-01-04  8:40   ` [PATCH] relax check for AIX in msdos partition table Olaf Hering
2007-01-04 13:20     ` Olaf Hering [this message]

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=20070104132053.GA24903@suse.de \
    --to=olh@suse.de \
    --cc=akpm@osdl.org \
    --cc=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).