From e3081b35cdeb1e568c61369e5b3b15b6e428d3c3 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Wed, 8 Mar 2017 11:49:55 -0500 Subject: Fix a couple dircache oopsies. Moving binding from queued to resolved was messed up if it was the first queued one and there were other resolved files open at the time of resolving it. Dircache info for a directory about to be recursively scanned should be filled before opening it. Would only affect a directory if it happened to be opening while it was being initialized. Change-Id: I26ccf219c382d7caf1424b5ddddc4793e74cb390 --- firmware/common/dircache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 8a75f3bbad..08457f2da1 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -425,15 +425,18 @@ static void binding_resolve(const struct file_base_info *infop) } if (p == dcrivolp->queued0) + { dcrivolp->queued0 = BINDING_NEXT(p); + if (dcrivolp->resolved0 == NULL) + dcrivolp->resolved0 = p; + } else { file_binding_remove_next(prevp, p); file_binding_insert_first(p); + dcrivolp->resolved0 = p; } - dcrivolp->resolved0 = p; - /* srcinfop may be the actual one */ if (&p->info != infop) p->info.dcfile = infop->dcfile; @@ -1375,6 +1378,8 @@ static void sab_process_sub(struct sab *sabp) infop->fatfile.dircluster = dircluster; infop->fatfile.e.entry = ce->direntry; infop->fatfile.e.entries = ce->direntries; + infop->dcfile.idx = idx; + infop->dcfile.serialnum = ce->serialnum; } /* end while */ } -- cgit