cache: properly report ENOTDIR on foo/bar lookups where foo is a file

Reported by:	fernape
This commit is contained in:
Mateusz Guzik 2020-10-01 08:46:21 +00:00
parent 755cc40c21
commit b5ab177a99

View File

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