HomeFreeBSD

vfs: prevent avoidable evictions on mkdir of existing directories

Description

vfs: prevent avoidable evictions on mkdir of existing directories

mkdir -p /foo/bar/baz will mkdir each path component and ignore EEXIST.

The NOCACHE lookup will make the namecache unnecessarily evict the existing entry,
and then fallback to the fs lookup routine eventually leading namei to return an
error as the directory is already there.

For invocations like mkdir -p /usr/obj/usr/src/sys/GENERIC/modules this triggers
fallbacks to the slowpath for concurrently executing lookups.

Tested by: pho
Discussed with: kib

Details

Provenance
mjgAuthored on
Parents
rS366949: stablerestart(5): Fix some issues reported by mandoc
Branches
Unknown
Tags
Unknown