grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] FAT/exFAT: Fix wrong size detection for files > 4GB


From: Vladimir 'phcoder' Serbinenko
Subject: Re: [PATCH] FAT/exFAT: Fix wrong size detection for files > 4GB
Date: Fri, 27 Jan 2017 22:12:17 +0000

Committed, thanks. Sorry for delay

On Thu, 25 Aug 2016, 13:52 Carlo Caione <address@hidden> wrote:
On Wed, Aug 24, 2016 at 9:37 PM, Andrei Borzenkov <address@hidden> wrote:
> 24.08.2016 16:36, Carlo Caione пишет:
>> From: Carlo Caione <address@hidden>
>>
>> For exFAT the file size can be > 4GB. The 'grub_fat_data' is still
>> marking the 'file_size' as grub_ssize_t that is always 32bit when
>> compiling for i386-pc also when using exFAT.
>>
>> This is causing a problem when trying to open in loopback a > 4GB file
>> from an exFAT partition.
>>
>> Fix this modifying the size of the 'file_size' according to the
>> MODE_EXFAT define.
>>
>> Signed-off-by: Carlo Caione <address@hidden>
>> ---
>>  grub-core/fs/fat.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/grub-core/fs/fat.c b/grub-core/fs/fat.c
>> index 79fe864..d5212c2 100644
>> --- a/grub-core/fs/fat.c
>> +++ b/grub-core/fs/fat.c
>> @@ -183,7 +183,11 @@ struct grub_fat_data
>>    grub_uint32_t num_clusters;
>>
>>    grub_uint8_t attr;
>> -  grub_ssize_t file_size;
>> +#ifndef MODE_EXFAT
>> +  grub_uint32_t file_size;
>> +#else
>> +  grub_uint64_t file_size;
>> +#endif
>>    grub_uint32_t file_cluster;
>>    grub_uint32_t cur_cluster_num;
>>    grub_uint32_t cur_cluster;
>>
>
> Looks correct except I'd use conditon "ifdef MODE_EXFAT", negative
> condition looks strange in such cases.

This pattern is literally used 5 lines above and all over the place in fat.c
It would look strange otherwise.

--
Carlo Caione  |  +39.340.80.30.096  |  Endless

_______________________________________________
Grub-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/grub-devel

reply via email to

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