[parted-devel] FAT_TYPE_FAT12 not handled in many switches

Jim Meyering jim at meyering.net
Fri Feb 16 15:20:46 CET 2007


David Cantrell <dcantrell at redhat.com> wrote:
>> Two examples:
>> ==========================================
>>
>> static int
>> _test_code_bad (const FatTable* ft, FatCluster code)
>> {
>> 	switch (ft->fat_type) {
>> 		case FAT_TYPE_FAT16:
>> 		if (code == 0xfff7) return 1;
>> 		break;
>>
>> 		case FAT_TYPE_FAT32:
>> 		if (code == 0x0ffffff7) return 1;
>> 		break;
>> 	}
>> 	return 0;
>> }

Thanks again for the pointers.

> Add:
>
> case FAT_TYPE_FAT12:
> if (code == 0xff0) return 1;

Hmm...
it looks like doc/FAT is saying to use 0xff7 there:

    * bad cluster (0xff7 for FAT12, 0xfff7 for FAT16, 0x0ffffff7 for FAT32).
    Indicates the disk is physically damaged where the cluster is stored.



More information about the parted-devel mailing list