From: Heinrich Schuchardt Date: Tue, 9 Jun 2020 09:19:03 +0200 Subject: [PATCH] fs: fat: fix fat iteration In-Reply-To: <20200609070907.546971-1-christian.gmeiner@gmail.com> References: <20200609070907.546971-1-christian.gmeiner@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 09.06.20 09:09, Christian Gmeiner wrote: > According to the FAT specification it is valid to have files with an > attribute value of 0x0. This fixes a regression where different U-Boot > versions are showing different amount of files on the same storage > device. With this change U-Boot shows the same number of files and folders > as Linux and Windows. > > Fixes: 39606d462c ("fs: fat: handle deleted directory entries correctly") > Signed-off-by: Christian Gmeiner Thanks for reporting and resolving the issue. Could you, please, provide a test image to reproduce the issue. Further it would be helpful to add a test case in test/py/tests/test_fs. Best regards Heinrich > --- > fs/fat/fat.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/fs/fat/fat.c b/fs/fat/fat.c > index 7fd29470c1..9578b74bae 100644 > --- a/fs/fat/fat.c > +++ b/fs/fat/fat.c > @@ -949,9 +949,7 @@ static int fat_itr_next(fat_itr *itr) > /* Volume label or VFAT entry, skip */ > continue; > } > - } else if (!(dent->attr & ATTR_ARCH) && > - !(dent->attr & ATTR_DIR)) > - continue; > + } > > /* short file name */ > break; >