diff -ur util-linux-2.12-3/fdisk/cfdisk.c util-linux-2.12-3+jfs/fdisk/cfdisk.c
--- util-linux-2.12-3/fdisk/cfdisk.c	2003-10-12 17:00:52.000000000 +0200
+++ util-linux-2.12-3+jfs/fdisk/cfdisk.c	2003-10-12 20:39:50.000000000 +0200
@@ -51,6 +51,9 @@
  *  XFS label recognition.
  * Thu Nov 22 15:42:56 CET 2001 <flavio.stanchina@tin.it>
  *  ext3 and ReiserFS recognition.
+ * Sun Oct 12 17:43:43 CEST 2003 <flavio.stanchina@tin.it>
+ *  JFS recognition. (am I the only one who likes this feature?)
+ *  ReiserFS label recognition.
  *
  ****************************************************************************/
 
@@ -85,6 +88,11 @@
 #include "get_blocks.h"
 #include "common.h"
 
+/* HACK: Is this OK? If not, someone copy over the definition for
+ * struct jfs_super_block and don't remove the other superblocks...
+ */
+#include "../mount/linux_fs.h"
+
 extern long long ext2_llseek(unsigned int fd, long long offset,
 			     unsigned int origin);
 
@@ -410,6 +418,8 @@
 	      return _("Linux ext3");
 	 else if (!strcmp(p_info[i].fstype, "xfs"))
 	      return _("Linux XFS");
+	 else if (!strcmp(p_info[i].fstype, "jfs"))
+	      return _("Linux JFS");
 	 else if (!strcmp(p_info[i].fstype, "reiserfs"))
 	      return _("Linux ReiserFS");
 	 else
@@ -625,50 +635,38 @@
 	}
 }
 
-#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
-#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
-struct reiserfs_super_block {
-	char s_dummy0[ 52];
-	char s_magic [ 12];
-	char s_dummy1[140];
-};
-
 static int
-is_reiserfs_magic_string(const struct reiserfs_super_block *rs) {
-	return (!strncmp(rs->s_magic, REISERFS_SUPER_MAGIC_STRING,
-			 strlen(REISERFS_SUPER_MAGIC_STRING)) ||
-		!strncmp(rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
-			 strlen(REISER2FS_SUPER_MAGIC_STRING)));
+is_reiserfs_magic_string(const struct reiserfs_super_block *rs, int *is_3_6) {
+	if (!strncmp(rs->s_magic, REISERFS_SUPER_MAGIC_STRING,
+		     strlen(REISERFS_SUPER_MAGIC_STRING))) {
+		*is_3_6 = 0;
+		return 1;
+	}
+
+	if (!strncmp(rs->s_magic, REISER2FS_SUPER_MAGIC_STRING,
+		     strlen(REISER2FS_SUPER_MAGIC_STRING))) {
+		*is_3_6 = 1;
+		return 1;
+	}
+
+	return 0;
 }
 
 static void
 get_linux_label(int i) {
 
-#define EXT2LABELSZ 16
-#define EXT2_SUPER_MAGIC 0xEF53
-#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
-	struct ext2_super_block {
-		char  s_dummy0[56];
-		unsigned char  s_magic[2];
-		char  s_dummy1[34];
-		unsigned char  s_feature_compat[4];
-		char  s_dummy2[24];
-		char  s_volume_name[EXT2LABELSZ];
-		char  s_last_mounted[64];
-		char  s_dummy3[824];
-	} e2fsb;
+#define EXT2LABELSZ sizeof(e2fsb.s_volume_name)
+	struct ext2_super_block e2fsb;
 
-#define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024)
+#define REISERFSLABELSZ sizeof(reiserfsb.s_label)
 	struct reiserfs_super_block reiserfsb;
+	int reiserfs_is_3_6;
+
+#define XFSLABELSZ sizeof(xfsb.s_fname)
+	struct xfs_super_block xfsb;
 
-#define XFS_SUPER_MAGIC "XFSB"
-#define XFSLABELSZ 12
-	struct xfs_super_block {
-		unsigned char   s_magic[4];
-		unsigned char   s_dummy0[104];
-		unsigned char   s_fname[XFSLABELSZ];
-		unsigned char   s_dummy1[904];
-	} xfsb;
+#define JFSLABELSZ sizeof(jfsb.s_label)
+	struct jfs_super_block jfsb;
 
 	char *label;
 	long long offset;
@@ -694,7 +692,7 @@
 	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE + 0;
 	if (ext2_llseek(fd, offset, SEEK_SET) == offset
 	    && read(fd, &xfsb, sizeof(xfsb)) == sizeof(xfsb)
-	    && !strcmp(xfsb.s_magic, XFS_SUPER_MAGIC)) {
+	    && !strncmp(xfsb.s_magic, XFS_SUPER_MAGIC, strlen(XFS_SUPER_MAGIC))) {
 		label = xfsb.s_fname;
 		for(j=0; j<XFSLABELSZ && j<LABELSZ && isprint(label[j]); j++)
 			p_info[i].volume_label[j] = label[j];
@@ -703,12 +701,33 @@
 		return;
 	}
 
+	/* JFS? */
+	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
+		+ JFS_SUPER1_OFF;
+	if (ext2_llseek(fd, offset, SEEK_SET) == offset
+	    && read(fd, &jfsb, sizeof(jfsb)) == sizeof(jfsb)
+	    && !strncmp(jfsb.s_magic, JFS_MAGIC, strlen(JFS_MAGIC))) {
+		label = jfsb.s_label;
+		for(j=0; j<JFSLABELSZ && j<LABELSZ && isprint(label[j]); j++)
+			p_info[i].volume_label[j] = label[j];
+		p_info[i].volume_label[j] = 0;
+		strncpy(p_info[i].fstype, "jfs", FSTYPESZ);
+		return;
+	}
+
 	/* reiserfs? */
 	offset = (p_info[i].first_sector + p_info[i].offset) * SECTOR_SIZE
 		+ REISERFS_DISK_OFFSET_IN_BYTES;
 	if (ext2_llseek(fd, offset, SEEK_SET) == offset
 	    && read(fd, &reiserfsb, 1024) == 1024
-	    && is_reiserfs_magic_string(&reiserfsb)) {
+	    && is_reiserfs_magic_string(&reiserfsb, &reiserfs_is_3_6)) {
+		if (reiserfs_is_3_6) {
+			/* label is only on version 3.6 onward */
+			label = reiserfsb.s_label;
+			for(j=0; j<REISERFSLABELSZ && j<LABELSZ && isprint(label[j]); j++)
+				p_info[i].volume_label[j] = label[j];
+			p_info[i].volume_label[j] = 0;
+		}
 		strncpy(p_info[i].fstype, "reiserfs", FSTYPESZ);
 		return;
 	}
diff -ur util-linux-2.12-3/mount/linux_fs.h util-linux-2.12-3+jfs/mount/linux_fs.h
--- util-linux-2.12-3/mount/linux_fs.h	2003-07-05 22:16:32.000000000 +0200
+++ util-linux-2.12-3+jfs/mount/linux_fs.h	2003-10-12 19:56:15.000000000 +0200
@@ -60,8 +60,17 @@
 	u_char	s_feature_ro_compat[4];
 	u_char	s_uuid[16];
 	u_char 	s_volume_name[16];
-	u_char	s_dummy3[88];
+	u_char	s_last_mounted[64];
+	u_char	s_algorithm_usage_bitmap[4];
+	u_char	s_prealloc_blocks;
+	u_char	s_prealloc_dir_blocks;
+	u_char	s_padding1[2];
+	u_char	s_journal_uuid[16];	/* ext3 only */
 	u_char	s_journal_inum[4];	/* ext3 only */
+	u_char	s_journal_dev[4];	/* ext3 only */
+	u_char	s_last_orphan[4];	/* ext3 only */
+	u_char	s_reserved[788];
+	/* NOTE: cfdisk will segfault if this is not 1024 bytes long */
 };
 #define ext2magic(s)	assemble2le(s.s_magic)
 
@@ -82,7 +91,18 @@
 	u_char		s_oid_maxsize[2];
 	u_char		s_oid_cursize[2];
 	u_char		s_state[2];
-	u_char		s_magic[12];
+	u_char		s_magic[10];
+	u_char		s_fs_state[2];
+	u_char		s_hash_function_code[4];
+	u_char		s_tree_height[2];
+	u_char		s_bmap_nr[2];
+	u_char		s_version[2];
+	u_char		s_reserved_for_journal[2];
+	u_char		s_inode_generation[4];
+	u_char		s_flags[4];
+	unsigned char	s_uuid[16];
+	unsigned char	s_label[16];
+	char		s_unused[88];
 };
 #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
 #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"

