+ ignore-partition-table-on-disks-with-aix-label.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     ignore partition table on disks with AIX label

has been added to the -mm tree.  Its filename is

     ignore-partition-table-on-disks-with-aix-label.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: ignore partition table on disks with AIX label
From: Olaf Hering <olh@xxxxxxx>

The on-disk data structures from AIX are not known, also the filesystem
layout is not known.  There is a msdos partition signature at the end of
the first block, and the kernel recognizes 3 small (and overlapping)
partitions.  But they are not usable.  Maybe the firmware uses it to find
the bootloader for AIX, but AIX boots also if the first block is cleared.

This is the content of the partition table:
 # dd if=/dev/sdb count=$(( 4 * 16 )) bs=1 skip=$(( 0x1be )) | xxd
0000000: 0000 0000 0000 0000 0000 0000 0000 0000  ................
0000010: 80ff ffff 41ff ffff 1b11 0000 381b 0000  ....A.......8...
0000020: 00ff ffff 41ff ffff 0211 0000 1900 0000  ....A...........
0000030: 80ff ffff 41ff ffff 1b11 0000 381b 0000  ....A.......8...

Handle the whole disk as empty disk.

This fixes also YaST which compares the output from parted (and formerly
fdisk) with /proc/partitions.  fdisk recognizes the AIX label since a long
time, SuSE has a patch for parted to handle the disk label as unknown.

dmesg will look like this:
 sda: [AIX]  unknown partition table

Tested on an IBM B50 with AIX V4.3.3.

Signed-off-by: Olaf Hering <olh@xxxxxxx>
Cc: Albert Cahalan <acahalan@xxxxxxxxx>
Cc: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/partitions/msdos.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff -puN fs/partitions/msdos.c~ignore-partition-table-on-disks-with-aix-label fs/partitions/msdos.c
--- a/fs/partitions/msdos.c~ignore-partition-table-on-disks-with-aix-label
+++ a/fs/partitions/msdos.c
@@ -58,6 +58,31 @@ msdos_magic_present(unsigned char *p)
 	return (p[0] == MSDOS_LABEL_MAGIC1 && p[1] == MSDOS_LABEL_MAGIC2);
 }
 
+/* Value is EBCDIC 'IBMA' */
+#define AIX_LABEL_MAGIC1	0xC9
+#define AIX_LABEL_MAGIC2	0xC2
+#define AIX_LABEL_MAGIC3	0xD4
+#define AIX_LABEL_MAGIC4	0xC1
+static int aix_magic_present(unsigned char *p, struct block_device *bdev)
+{
+	Sector sect;
+	unsigned char *d;
+	int ret = 0;
+
+	if (p[0] != AIX_LABEL_MAGIC1 &&
+		p[1] != AIX_LABEL_MAGIC2 &&
+		p[2] != AIX_LABEL_MAGIC3 &&
+		p[3] != AIX_LABEL_MAGIC4)
+		return 0;
+	d = read_dev_sector(bdev, 7, &sect);
+	if (d) {
+		if (d[0] == '_' && d[1] == 'L' && d[2] == 'V' && d[3] == 'M')
+			ret = 1;
+		put_dev_sector(sect);
+	};
+	return ret;
+}
+
 /*
  * Create devices for each logical partition in an extended partition.
  * The logical partitions form a linked list, with each entry being
@@ -393,6 +418,12 @@ int msdos_partition(struct parsed_partit
 		return 0;
 	}
 
+	if (aix_magic_present(data, bdev)) {
+		put_dev_sector(sect);
+		printk( " [AIX]");
+		return 0;
+	}
+
 	/*
 	 * Now that the 55aa signature is present, this is probably
 	 * either the boot sector of a FAT filesystem or a DOS-type
_

Patches currently in -mm which might be from olh@xxxxxxx are

enable-mac-partition-label-per-default-on-pmac.patch
hide-onboard-graphics-drivers-on-g5.patch
remove-rpm_build_root-from-asm-offsetsh.patch
use-gcc-o1-in-fs-reiserfs-only-for-ancient-gcc-versions.patch
ignore-partition-table-on-disks-with-aix-label.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux