Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a470e18f authored by Olaf Hering's avatar Olaf Hering Committed by Linus Torvalds
Browse files

[PATCH] msdos partitions: fix logic error in AIX detection



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

Signed-off-by: default avatarOlaf Hering <olh@suse.de>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Anton Blanchard <anton@samba.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4419d1ac
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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++) {