We should not attempt to make a map of more LDLINUX.SYS
sectors than we have. Simply multiplying a cluster count
times the number of sectors per cluster does not account
for unused sectors in the last used cluster.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
len.QuadPart = ((extent.NextVcn.QuadPart -
extent.FirstVcn.QuadPart) *
vol_info.SectorsPerCluster);
- while (len.QuadPart--) {
+ while (len.QuadPart-- && nsectors < ldlinux_sectors) {
*secp++ = lba.QuadPart++;
nsectors++;
}