svn commit: r366742 - head/sys/kern
Mateusz Guzik
mjg at FreeBSD.org
Fri Oct 16 00:55:58 UTC 2020
Author: mjg
Date: Fri Oct 16 00:55:57 2020
New Revision: 366742
URL: https://svnweb.freebsd.org/changeset/base/366742
Log:
cache: elide vhold/vdrop around promoting negative entry
Modified:
head/sys/kern/vfs_cache.c
Modified: head/sys/kern/vfs_cache.c
==============================================================================
--- head/sys/kern/vfs_cache.c Fri Oct 16 00:55:31 2020 (r366741)
+++ head/sys/kern/vfs_cache.c Fri Oct 16 00:55:57 2020 (r366742)
@@ -3394,9 +3394,6 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl,
cnp = fpl->cnp;
dvp = fpl->dvp;
- if (!vhold_smr(dvp))
- return (cache_fpl_aborted(fpl));
-
nl = NCP2NEGLIST(oncp);
cache_fpl_smr_exit(fpl);
@@ -3409,6 +3406,10 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl,
/*
* Avoid all surprises by only succeeding if we got the same entry and
* bailing completely otherwise.
+ * XXX There are no provisions to keep the vnode around, meaning we may
+ * end up promoting a negative entry for a *new* vnode and returning
+ * ENOENT on its account. This is the error we want to return anyway
+ * and promotion is harmless.
*
* In particular at this point there can be a new ncp which matches the
* search but hashes to a different neglist.
@@ -3451,12 +3452,10 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl,
counter_u64_add(numneghits, 1);
cache_fpl_smr_exit(fpl);
mtx_unlock(&nl->nl_lock);
- vdrop(dvp);
return (cache_fpl_handled(fpl, ENOENT));
out_abort:
cache_fpl_smr_exit(fpl);
mtx_unlock(&nl->nl_lock);
- vdrop(dvp);
return (cache_fpl_aborted(fpl));
}
More information about the svn-src-head
mailing list