[PATCH] 2.4.8 -- LDM build fix

Richard Russon (ntfs@flatcap.org)
12 Aug 2001 16:55:07 +0100


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)
ntfs@flatcap.org

--

diff -urN linux-2.4.8/fs/partitions/ldm.c linux-2.4.8-ldm/fs/partitions/ldm.c --- linux-2.4.8/fs/partitions/ldm.c Sun Aug 12 16:45:00 2001 +++ linux-2.4.8-ldm/fs/partitions/ldm.c Sun Aug 12 16:44:53 2001 @@ -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? */ diff -urN linux-2.4.8/fs/partitions/ldm.h linux-2.4.8-ldm/fs/partitions/ldm.h --- linux-2.4.8/fs/partitions/ldm.h Sun Aug 12 14:57:56 2001 +++ linux-2.4.8-ldm/fs/partitions/ldm.h Sun Aug 12 16:18:27 2001 @@ -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); \ })

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/