info-mtools
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Info-mtools] Bug: mformat does not format FAT32 correctly


From: Pali Rohár
Subject: Re: [Info-mtools] Bug: mformat does not format FAT32 correctly
Date: Tue, 25 Sep 2018 23:22:00 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Saturday 11 August 2018 12:45:09 Pali Rohár wrote:
> @@ -564,13 +576,13 @@ static void calc_cluster_size(struct Fs_
>       /* double the cluster size until we can fill up the disk with
>        * the maximal number of sectors of this size */
>       while(Fs->cluster_size * max_clusters  + max_fat_size < rem_sect) {
> +             Fs->cluster_size <<= 1;
>               if(Fs->cluster_size > 64) {
>                       /* bigger than 64. Should fit */
>                       fprintf(stderr,
>                               "Internal error while calculating cluster 
> size\n");
>                       exit(1);
>               }
> -             Fs->cluster_size <<= 1;
>       }
>  }
>  

Looks like above change is wrong. Both Linux and Windows FAT drivers can
read FAT also with cluster size 128. So there is no need to restrict it
to 64, and use previous code as before.

-- 
Pali Rohár
address@hidden

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]