diff -urN util-linux-2.11u/mount/linux_fs.h util-linux-2.11u-patched/mount/linux_fs.h --- util-linux-2.11u/mount/linux_fs.h 2002-08-03 16:09:43.000000000 -0500 +++ util-linux-2.11u-patched/mount/linux_fs.h 2002-08-29 00:54:27.000000000 -0500 @@ -83,12 +83,24 @@ u_char s_oid_cursize[2]; u_char s_state[2]; u_char s_magic[12]; + 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[2]; + u_char s_inode_generation[4]; + u_char s_flags[4]; + u_char s_uuid[16]; + u_char s_label[16]; + u_char s_unused[88]; }; #define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" #define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" #define REISERFS_DISK_OFFSET_IN_BYTES (64 * 1024) /* the spot for the super in versions 3.5 - 3.5.10 (inclusive) */ #define REISERFS_OLD_DISK_OFFSET_IN_BYTES (8 * 1024) +#define reiserfsmagic(s) assemble2le(s.s_magic) + #define _XIAFS_SUPER_MAGIC 0x012FD16D struct xiafs_super_block { diff -urN util-linux-2.11u/mount/mount_by_label.c util-linux-2.11u-patched/mount/mount_by_label.c --- util-linux-2.11u/mount/mount_by_label.c 2002-08-03 19:07:10.000000000 -0500 +++ util-linux-2.11u-patched/mount/mount_by_label.c 2002-08-29 00:55:46.000000000 -0500 @@ -81,6 +81,7 @@ struct ext2_super_block e2sb; struct xfs_super_block xfsb; struct jfs_super_block jfssb; + struct reiserfs_super_block rfssb; fd = open(device, O_RDONLY); if (fd < 0) @@ -128,6 +129,15 @@ } rv = 0; } + else if (lseek(fd, REISERFS_DISK_OFFSET_IN_BYTES, SEEK_SET) == REISERFS_DISK_OFFSET_IN_BYTES + && read(fd, (char *) &rfssb, sizeof(rfssb)) == sizeof(rfssb) + && (reiserfsmagic(rfssb) == REISER2FS_SUPER_MAGIC_STRING)) { + memcpy(uuid, rfssb.s_uuid, sizeof(rfssb.s_uuid)); + namesize = sizeof(rfssb.s_label); + if ((*label = calloc(namesize + 1, 1)) != NULL) + memcpy(*label, rfssb.s_label, namesize); + rv = 0; + } close(fd); return rv;