mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-24 16:19:22 +00:00
fsys_fat: Fixed calculation of FAT_SUPER->num_clust.
This commit is contained in:
1 parent
529a2dc5e0
commit
436fb5ce95
2 files changed
+9
-2
No files matched your search
@@ -1,3 +1,9 @@
|
|||||||
|
2000-07-25 Jochen Hoenicke <jochen@gnu.org>
|
||||||
|
|
||||||
|
* stage2/fsys_fat.c (fat_mount): Fixed calculation of num_clust.
|
||||||
|
It was off by two, since the two non existing clusters 0 and 1
|
||||||
|
were not taken into account.
|
||||||
|
|
||||||
2000-07-25 OKUJI Yoshinori <okuji@gnu.org>
|
2000-07-25 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
* stage2/asm.S [!STAGE1_5] (linux_text_len): New variable.
|
* stage2/asm.S [!STAGE1_5] (linux_text_len): New variable.
|
||||||
|
|||||||
+3
-2
@@ -106,7 +106,8 @@ fat_mount (void)
|
|||||||
FAT_SUPER->root_offset
|
FAT_SUPER->root_offset
|
||||||
+ ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1;
|
+ ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1;
|
||||||
FAT_SUPER->num_clust =
|
FAT_SUPER->num_clust =
|
||||||
(FAT_SUPER->num_sectors - FAT_SUPER->data_offset) / bpb.sects_per_clust;
|
2 + ((FAT_SUPER->num_sectors - FAT_SUPER->data_offset)
|
||||||
|
/ bpb.sects_per_clust);
|
||||||
FAT_SUPER->sects_per_clust = bpb.sects_per_clust;
|
FAT_SUPER->sects_per_clust = bpb.sects_per_clust;
|
||||||
|
|
||||||
if (!bpb.fat_length)
|
if (!bpb.fat_length)
|
||||||
@@ -136,7 +137,7 @@ fat_mount (void)
|
|||||||
|| FAT_CVT_U16(bpb.bytes_per_sect) != SECTOR_SIZE
|
|| FAT_CVT_U16(bpb.bytes_per_sect) != SECTOR_SIZE
|
||||||
|| bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits
|
|| bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits
|
||||||
- FAT_SUPER->sectsize_bits))
|
- FAT_SUPER->sectsize_bits))
|
||||||
|| FAT_SUPER->num_clust <= 0
|
|| FAT_SUPER->num_clust <= 2
|
||||||
|| (FAT_SUPER->fat_size * FAT_SUPER->num_clust / (2 * SECTOR_SIZE)
|
|| (FAT_SUPER->fat_size * FAT_SUPER->num_clust / (2 * SECTOR_SIZE)
|
||||||
> FAT_SUPER->fat_length))
|
> FAT_SUPER->fat_length))
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user