Skip to contentSkip to conversation

exfat: Read the contiguous flag from the correct extension

PATCH In review Carlo Caione 2 participants 2 messages Oct 19, 2016 – Oct 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exfat: Read the contiguous flag from the correct extension

From: Carlo Caione <[email protected]>

dir.is_contiguous flag is being set reading into the wrong struct. This is causing a fragmented file not to be readable from an exfat partition since the NoFatChain bit is wrong. Fix this.

---
 grub-core/fs/fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/fs/fat.c +1 -1
index d5212c2..dd8850a 100644
@@ -684,7 +684,7 @@ grub_fat_iterate_dir_next (grub_disk_t disk, struct grub_fat_data *data,
 		  ctxt->dir.file_size
 		    = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size);
 		  ctxt->dir.have_stream = 1;
-		  ctxt->dir.is_contiguous = !!(dir.type_specific.stream_extension.flags
+		  ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags
 					       & grub_cpu_to_le16_compile_time (FLAG_CONTIGUOUS));
 		  break;
 		case 0xc1:
Signature · 1 line
2.7.4
#1 lore raw

19.10.2016 18:20, Carlo Caione пишет:

Quoted 16 lines

From: Carlo Caione <[email protected]>

dir.is_contiguous flag is being set reading into the wrong struct. This is causing a fragmented file not to be readable from an exfat partition since the NoFatChain bit is wrong. Fix this.

---
 grub-core/fs/fat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/fs/fat.c +0 -0
index d5212c2..dd8850a 100644

grub-core/fs/fat.c grub_fat_iterate_dir_next (grub_disk_t disk, struct grub_fat_data *data, · line 687

Quoted 5 lines
grub-core/fs/fat.c +1 -1
@@ -684,7 +684,7 @@ grub_fat_iterate_dir_next (grub_disk_t disk, struct grub_fat_data *data,
 		  ctxt->dir.file_size
 		    = grub_cpu_to_le64 (sec.type_specific.stream_extension.file_size);
 		  ctxt->dir.have_stream = 1;
-		  ctxt->dir.is_contiguous = !!(dir.type_specific.stream_extension.flags
+		  ctxt->dir.is_contiguous = !!(sec.type_specific.stream_extension.flags

This is fixed almost a year ago. Please always check current git whether problem still exists. Thank you.

Quoted 4 lines
grub-core/fs/fat.c +0 -0
 					       & grub_cpu_to_le16_compile_time (FLAG_CONTIGUOUS));
 		  break;
 		case 0xc1: