svn commit: r362889 - head/sys/kern
Mateusz Guzik
mjg at FreeBSD.org
Thu Jul 2 12:56:21 UTC 2020
Author: mjg
Date: Thu Jul 2 12:56:20 2020
New Revision: 362889
URL: https://svnweb.freebsd.org/changeset/base/362889
Log:
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.
Modified:
head/sys/kern/vfs_cache.c
Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c Thu Jul 2 12:54:50 2020 (r362888)
+++ head/sys/kern/vfs_cache.c Thu Jul 2 12:56:20 2020 (r362889)
@@ -1342,7 +1342,7 @@ cache_lookup(struct vnode *dvp, struct vnode **vpp, st
uint32_t hash;
enum vgetstate vs;
int error, ltype;
- bool try_smr, doing_smr;
+ bool try_smr, doing_smr, whiteout;
#ifdef DEBUG_CACHE
if (__predict_false(!doingcache)) {
@@ -1498,28 +1498,28 @@ negative_success:
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 ((ncp->nc_flag & NCF_HOTNEGATIVE) == 0) {
- /*
- * We need to take locks to promote the entry.
- */
+ /*
+ * We need to take locks to promote an entry.
+ */
+ if ((ncp->nc_flag & NCF_HOTNEGATIVE) == 0 ||
+ cache_ncp_invalid(ncp)) {
vfs_smr_exit();
doing_smr = false;
goto retry_hashed;
}
+ vfs_smr_exit();
} else {
cache_negative_hit(ncp);
+ cache_lookup_unlock(blp, dvlp);
}
- counter_u64_add(numneghits, 1);
- if (ncp->nc_flag & NCF_WHITE)
+ if (whiteout)
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);
return (ENOENT);
zap_and_exit:
More information about the svn-src-all
mailing list