Date: Fri, 16 Oct 2020 00:55:57 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366742 - head/sys/kern Message-ID: <202010160055.09G0tvLf086404@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010160055.09G0tvLf086404>