On Jul 22, OKUJI Yoshinori wrote:
> From: "Alecsandru Soare" <[EMAIL PROTECTED]>
> Subject: Reading problems with FAT16
> Date: Tue, 18 Jul 2000 15:36:18 +0300
> 
> >     I use grub ver. 0.5.94 and I encounter problems when I try to use initrd
> > command to load an Linux root image from a FAT16 partition. I think that
> > grub has reading problems(not always) with big fragmented files located on a
> > FAT16 fs. The image is good and works if I try to load it from an ext2 fs.
> 
>   Thanks for your report. Jochen, can you investigate that? Can you
> reproduce the same problem?


I contacted Alecsandru and he sent me the output of mshowfat (mtools)
and grub's blocklist for the errornous file.

The problem is that the file spans exactly until the end of the disk,
and FAT's "num_clust" calculation is off by two.  It seems that I have
introduced this bug, sorry.

I checked the fix into the CVS repository.  Here is the important
part, if you don't want to upgrade.

  Jochen

diff -u -r1.11 grub/stage2/fsys_fat.c
--- grub/stage2/fsys_fat.c      2000/04/15 13:39:38     1.11
+++ grub/stage2/fsys_fat.c      2000/07/25 14:37:55
@@ -106,7 +106,8 @@
     FAT_SUPER->root_offset
     + ((FAT_SUPER->root_max - 1) >> FAT_SUPER->sectsize_bits) + 1;
   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;
   
   if (!bpb.fat_length)

Reply via email to