From: Olaf Hering Date: Sat, 10 Feb 2007 09:45:48 +0000 (-0800) Subject: [PATCH] msdos partitions: fix logic error in AIX detection X-Git-Tag: v2.6.21-rc1~274^2~301 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a470e18f53940e7bd07b09f01c0970f653e268bf;p=linux-2.6 [PATCH] msdos partitions: fix logic error in AIX detection Correct the AIX magic check to let 'echo > /dev/sdb' actually work. Signed-off-by: Olaf Hering Cc: OGAWA Hirofumi Cc: Anton Blanchard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index dafd3b6b2d..78443e07b3 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c @@ -68,10 +68,10 @@ static int aix_magic_present(unsigned char *p, struct block_device *bdev) 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++) {