From 35bce9696160fbed33b6bad15c632cc0b55b0758 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 25 Jun 2010 15:23:42 -0700 Subject: [PATCH] mtools: include the size of the ADV in the mappable range We need to include the size of the ADV in the range of data that needs to be mapped. Signed-off-by: H. Peter Anvin --- mtools/syslinux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mtools/syslinux.c b/mtools/syslinux.c index ade8440..f5b89c9 100644 --- a/mtools/syslinux.c +++ b/mtools/syslinux.c @@ -261,7 +261,8 @@ int main(int argc, char *argv[]) /* * Now, use libfat to create a block map */ - ldlinux_sectors = (syslinux_ldlinux_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT; + ldlinux_sectors = (syslinux_ldlinux_len + 2 * ADV_SIZE + + SECTOR_SIZE - 1) >> SECTOR_SHIFT; sectors = calloc(ldlinux_sectors, sizeof *sectors); fs = libfat_open(libfat_xpread, dev_fd); ldlinux_cluster = libfat_searchdir(fs, 0, "LDLINUX SYS", NULL); -- 2.7.4