VirtualBox

Changeset 3082 in kBuild for trunk/src/lib/nt/kFsCache.c


Ignore:
Timestamp:
Oct 2, 2017 7:23:17 PM (8 years ago)
Author:
bird
Message:

nt/kFsCache: Fixed buggy negative lookup caching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/nt/kFsCache.c

    r3007 r3082  
    27482748 *                              failed.
    27492749 * @param   ppLastAncestor      Where to return the last parent element found
    2750  *                              (referenced) in case of error an path/file not
    2751  *                              found problem.  Optional.
     2750 *                              (referenced) in case of error like an path/file
     2751 *                              not found problem.  Optional.
    27522752 */
    27532753PKFSOBJ kFsCacheLookupRelativeToDirA(PKFSCACHE pCache, PKFSDIR pParent, const char *pszPath, KU32 cchPath, KU32 fFlags,
     
    27952795        { /* likely */ }
    27962796        else
     2797        {
     2798            if (ppLastAncestor)
     2799                *ppLastAncestor = kFsCacheObjRetainInternal(&pParent->Obj);
    27972800            return NULL;
     2801        }
    27982802
    27992803        /*
     
    28362840            { /* likely */ }
    28372841            else
     2842            {
     2843                if (ppLastAncestor)
     2844                    *ppLastAncestor = kFsCacheObjRetainInternal(&pParent->Obj);
    28382845                return NULL;
     2846            }
    28392847            return kFsCacheObjRetainInternal(pChild);
    28402848        }
     
    28722880    }
    28732881
     2882    /* not reached */
    28742883    return NULL;
    2875 
    28762884}
    28772885
     
    28942902 *                              failed.
    28952903 * @param   ppLastAncestor      Where to return the last parent element found
    2896  *                              (referenced) in case of error an path/file not
    2897  *                              found problem.  Optional.
     2904 *                              (referenced) in case of error like an path/file
     2905 *                              not found problem.  Optional.
    28982906 */
    28992907PKFSOBJ kFsCacheLookupRelativeToDirW(PKFSCACHE pCache, PKFSDIR pParent, const wchar_t *pwszPath, KU32 cwcPath, KU32 fFlags,
     
    29412949        { /* likely */ }
    29422950        else
     2951        {
     2952            if (ppLastAncestor)
     2953                *ppLastAncestor = kFsCacheObjRetainInternal(&pParent->Obj);
    29432954            return NULL;
     2955        }
    29442956
    29452957        /*
     
    29822994            { /* likely */ }
    29832995            else
     2996            {
     2997                if (ppLastAncestor)
     2998                    *ppLastAncestor = kFsCacheObjRetainInternal(&pParent->Obj);
    29842999                return NULL;
     3000            }
    29853001            return kFsCacheObjRetainInternal(pChild);
    29863002        }
     
    30203036
    30213037    return NULL;
    3022 
    30233038}
    30243039
     
    30973112            || kFsCacheRefreshObj(pCache, pRoot, penmError))
    30983113            return kFsCacheObjRetainInternal(pRoot);
     3114        if (ppLastAncestor)
     3115            *ppLastAncestor = kFsCacheObjRetainInternal(pRoot);
    30993116        return NULL;
    31003117    }
     
    31963213            || kFsCacheRefreshObj(pCache, pRoot, penmError))
    31973214            return kFsCacheObjRetainInternal(pRoot);
     3215        if (ppLastAncestor)
     3216            *ppLastAncestor = kFsCacheObjRetainInternal(pRoot);
    31983217        return NULL;
    31993218    }
     
    35143533            || *penmError == KFSLOOKUPERROR_UNSUPPORTED )
    35153534            kFsCacheCreatePathHashTabEntryA(pCache, pFsObj, pchPath, cchPath, uHashPath, idxHashTab, fAbsolute,
    3516                                             pLastAncestor ? pLastAncestor->bObjType & KFSOBJ_F_USE_CUSTOM_GEN : 0, *penmError);
     3535                                            pLastAncestor ? pLastAncestor->fFlags & KFSOBJ_F_USE_CUSTOM_GEN : 0, *penmError);
    35173536        if (pLastAncestor)
    35183537            kFsCacheObjRelease(pCache, pLastAncestor);
     
    36223641            || *penmError == KFSLOOKUPERROR_UNSUPPORTED )
    36233642            kFsCacheCreatePathHashTabEntryW(pCache, pFsObj, pwcPath, cwcPath, uHashPath, idxHashTab, fAbsolute,
    3624                                             pLastAncestor ? pLastAncestor->bObjType & KFSOBJ_F_USE_CUSTOM_GEN : 0, *penmError);
     3643                                            pLastAncestor ? pLastAncestor->fFlags & KFSOBJ_F_USE_CUSTOM_GEN : 0, *penmError);
    36253644        if (pLastAncestor)
    36263645            kFsCacheObjRelease(pCache, pLastAncestor);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette