Date: Thu, 1 Oct 2020 08:46:21 +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: r366310 - head/sys/kern Message-ID: <202010010846.0918kLgE037400@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Thu Oct 1 08:46:21 2020 New Revision: 366310 URL: https://svnweb.freebsd.org/changeset/base/366310 Log: cache: properly report ENOTDIR on foo/bar lookups where foo is a file Reported by: fernape Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Thu Oct 1 04:46:23 2020 (r366309) +++ head/sys/kern/vfs_cache.c Thu Oct 1 08:46:21 2020 (r366310) @@ -4045,6 +4045,15 @@ static int __noinline cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) { + /* + * Hack: they may be looking up foo/bar, where foo is a + * regular file. In such a case we need to turn ENOTDIR, + * but we may happen to get here with a different error. + */ + if (fpl->dvp->v_type != VDIR) { + error = ENOTDIR; + } + switch (error) { case EAGAIN: /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202010010846.0918kLgE037400>