Skip to content

Commit

Permalink
[PATCH] msdos partitions: fix logic error in AIX detection
Browse files Browse the repository at this point in the history
Correct the AIX magic check to let 'echo > /dev/sdb' actually work.

Signed-off-by: Olaf Hering <[email protected]>
Cc: OGAWA Hirofumi <[email protected]>
Cc: Anton Blanchard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
olafhering authored and Linus Torvalds committed Feb 11, 2007
1 parent 4419d1a commit a470e18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/partitions/msdos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit a470e18

Please sign in to comment.