svn commit: r366310 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Thu Oct 1 08:46:22 UTC 2020


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:
 		/*


More information about the svn-src-head mailing list