Patchwork [U-Boot] fat: reset VFAT short alias checksum on first match

login
register
mail settings
Submitter Sergei Shtylyov
Date Jan. 2, 2012, 4:54 p.m.
Message ID <201201021954.29410.sshtylyov@ru.mvista.com>
Download mbox | patch
Permalink /patch/133914/
State Accepted
Commit bf34e7d952939b1d4289ef62e7d940fbd227c72a
Headers show

Comments

Sergei Shtylyov - Jan. 2, 2012, 4:54 p.m.
The VFAT short alias checksum read from a long file name is only overwritten
when another long file name appears in a directory list. Until then it renders
short file names invisible that have the same checksum. Reset the checksum on
first match.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Martin Mueller <martin.mueller5@de.bosch.com>

---
 fs/fat/fat.c |    2 ++
 1 file changed, 2 insertions(+)
Wolfgang Denk - Jan. 5, 2012, 3:03 p.m.
Dear Sergei Shtylyov,

In message <201201021954.29410.sshtylyov@ru.mvista.com> you wrote:
> The VFAT short alias checksum read from a long file name is only overwritten
> when another long file name appears in a directory list. Until then it renders
> short file names invisible that have the same checksum. Reset the checksum on
> first match.
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Signed-off-by: Martin Mueller <martin.mueller5@de.bosch.com>
> 
> ---
>  fs/fat/fat.c |    2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

Index: u-boot/fs/fat/fat.c
===================================================================
--- u-boot.orig/fs/fat/fat.c
+++ u-boot/fs/fat/fat.c
@@ -633,6 +633,7 @@  static dir_entry *get_dentfromdir (fsdat
 			}
 #ifdef CONFIG_SUPPORT_VFAT
 			if (dols && mkcksum(dentptr->name) == prevcksum) {
+				prevcksum = 0xffff;
 				dentptr++;
 				continue;
 			}
@@ -963,6 +964,7 @@  do_fat_read (const char *filename, void 
 #ifdef CONFIG_SUPPORT_VFAT
 			else if (dols == LS_ROOT &&
 				 mkcksum(dentptr->name) == prevcksum) {
+				prevcksum = 0xffff;
 				dentptr++;
 				continue;
 			}