Skip to contentSkip to conversation

2.4.8 -- LDM build fix

PATCH New Richard Russon 1 participant 1 message Aug 12, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.8 -- LDM build fix

Hi Linus,

The LDM code (Windows Dynamic Disks) has been broken for a few revisions now. Please apply this patch to fix it.

Cheers,
FlatCap (Rich)
[email protected]

--

fs/partitions/ldm.c +2 -1
diff -urN linux-2.4.8/fs/partitions/ldm.c linux-2.4.8-ldm/fs/partitions/ldm.c
@@ -141,7 +141,8 @@
 		printk(LDM_CRIT "Cannot find VBLK, database may be corrupt.\n");
 		return -1;
 	}
-	if (BE16(buffer + 0x0E) == 0)	/* Record is not in use. */
+	if ((BE16(buffer + 0x0E) == 0) ||       /* Record is not in use. */
+	    (BE16(buffer + 0x0C) != 0))         /* Part 2 of an ext. record */
 		return 0;
 
 	/* FIXME: What about extended VBLKs? */
fs/partitions/ldm.h +5 -5
diff -urN linux-2.4.8/fs/partitions/ldm.h linux-2.4.8-ldm/fs/partitions/ldm.h
@@ -81,13 +81,13 @@
 #define TOC_BITMAP2		"log"		/* bitmaps in the TOCBLOCK. */
 
 /* Borrowed from msdos.c */
-#define SYS_IND(p)		(get_unaligned(&p->sys_ind))
-#define NR_SECTS(p)		({ __typeof__(p->nr_sects) __a =	\
-					get_unaligned(&p->nr_sects);	\
+#define SYS_IND(p)		(get_unaligned(&(p)->sys_ind))
+#define NR_SECTS(p)		({ __typeof__((p)->nr_sects) __a =	\
+					get_unaligned(&(p)->nr_sects);	\
 					le32_to_cpu(__a);		\
 				})
-#define START_SECT(p)		({ __typeof__(p->start_sect) __a =	\
-					get_unaligned(&p->start_sect);	\
+#define START_SECT(p)		({ __typeof__((p)->start_sect) __a =	\
+					get_unaligned(&(p)->start_sect);\
 					le32_to_cpu(__a);		\
 				})