cache: add missing call to cache_ncp_invalid for negative hits
Note the dtrace probe can fire even the entry is gone, but I don't think that's worth fixing.
This commit is contained in:
parent
d129e0eba0
commit
d23850207b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362889
@ -1342,7 +1342,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
uint32_t hash;
|
uint32_t hash;
|
||||||
enum vgetstate vs;
|
enum vgetstate vs;
|
||||||
int error, ltype;
|
int error, ltype;
|
||||||
bool try_smr, doing_smr;
|
bool try_smr, doing_smr, whiteout;
|
||||||
|
|
||||||
#ifdef DEBUG_CACHE
|
#ifdef DEBUG_CACHE
|
||||||
if (__predict_false(!doingcache)) {
|
if (__predict_false(!doingcache)) {
|
||||||
@ -1498,28 +1498,28 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp,
|
|||||||
goto zap_and_exit;
|
goto zap_and_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp, ncp->nc_name);
|
||||||
|
cache_out_ts(ncp, tsp, ticksp);
|
||||||
|
counter_u64_add(numneghits, 1);
|
||||||
|
whiteout = (ncp->nc_flag & NCF_WHITE);
|
||||||
|
|
||||||
if (doing_smr) {
|
if (doing_smr) {
|
||||||
if ((ncp->nc_flag & NCF_HOTNEGATIVE) == 0) {
|
/*
|
||||||
/*
|
* We need to take locks to promote an entry.
|
||||||
* We need to take locks to promote the entry.
|
*/
|
||||||
*/
|
if ((ncp->nc_flag & NCF_HOTNEGATIVE) == 0 ||
|
||||||
|
cache_ncp_invalid(ncp)) {
|
||||||
vfs_smr_exit();
|
vfs_smr_exit();
|
||||||
doing_smr = false;
|
doing_smr = false;
|
||||||
goto retry_hashed;
|
goto retry_hashed;
|
||||||
}
|
}
|
||||||
|
vfs_smr_exit();
|
||||||
} else {
|
} else {
|
||||||
cache_negative_hit(ncp);
|
cache_negative_hit(ncp);
|
||||||
}
|
|
||||||
counter_u64_add(numneghits, 1);
|
|
||||||
if (ncp->nc_flag & NCF_WHITE)
|
|
||||||
cnp->cn_flags |= ISWHITEOUT;
|
|
||||||
SDT_PROBE2(vfs, namecache, lookup, hit__negative, dvp,
|
|
||||||
ncp->nc_name);
|
|
||||||
cache_out_ts(ncp, tsp, ticksp);
|
|
||||||
if (doing_smr)
|
|
||||||
vfs_smr_exit();
|
|
||||||
else
|
|
||||||
cache_lookup_unlock(blp, dvlp);
|
cache_lookup_unlock(blp, dvlp);
|
||||||
|
}
|
||||||
|
if (whiteout)
|
||||||
|
cnp->cn_flags |= ISWHITEOUT;
|
||||||
return (ENOENT);
|
return (ENOENT);
|
||||||
|
|
||||||
zap_and_exit:
|
zap_and_exit:
|
||||||
|
Loading…
Reference in New Issue
Block a user