summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-09-25 19:06:33 (GMT)
committerTom Rini <trini@konsulko.com>2017-10-06 15:28:19 (GMT)
commit8df8731474467782c6126f41da87618bcb84852a (patch)
treec209c844a5b786814b0df4ee14f236844dac1adb /fs
parentedce588a4541be6f0dee397f9b501b5569bbb892 (diff)
downloadu-boot-8df8731474467782c6126f41da87618bcb84852a.tar.xz
fs/fat: Fix pathnames using '..' that lead to the root directory
If we end up back in the root directory via a '..' directory entry, set itr->is_root accordingly. Failing to do that gives spews like "Invalid FAT entry" and being unable to access directory entries located past the first cluster of the root directory. Fixes: 8eafae209c35 ("fat/fs: convert to directory iterators") Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Diffstat (limited to 'fs')
-rw-r--r--fs/fat/fat.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 36a309c..3d3e17e 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -710,13 +710,14 @@ static void fat_itr_child(fat_itr *itr, fat_itr *parent)
itr->fsdata = parent->fsdata;
if (clustnum > 0) {
itr->clust = clustnum;
+ itr->is_root = 0;
} else {
itr->clust = parent->fsdata->root_cluster;
+ itr->is_root = 1;
}
itr->dent = NULL;
itr->remaining = 0;
itr->last_cluster = 0;
- itr->is_root = 0;
}
static void *next_cluster(fat_itr *itr)