From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Sat, 21 Nov 2020 11:34:20 +0000 (+0100)
Subject: fs: fat: directory entries starting with 0x05
X-Git-Tag: v2025.01-rc5-pxa1908~2114^2~4
X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B?a=commitdiff_plain;h=a2c5a92d4865cea53de8a9297a4f4d115e6ac3b6;p=u-boot.git

fs: fat: directory entries starting with 0x05

0x05 is used as replacement letter for 0xe5 at the first position of short
file names. We must not skip over directory entries starting with 0x05.

Cf. Microsoft FAT Specification, August 30 2005

Fixes: 39606d462c97 ("fs: fat: handle deleted directory entries correctly")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 28aa5aaa9f..fb6ba89466 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -926,8 +926,7 @@ static int fat_itr_next(fat_itr *itr)
 		if (!dent)
 			return 0;
 
-		if (dent->name[0] == DELETED_FLAG ||
-		    dent->name[0] == aRING)
+		if (dent->name[0] == DELETED_FLAG)
 			continue;
 
 		if (dent->attr & ATTR_VOLUME) {