Subject: namei(".") behaviour
To: None <email@example.com>
From: Juergen Hannken-Illjes <firstname.lastname@example.org>
Date: 07/29/2003 18:26:44
While looking over the filesystem snapshot code from FreeBSD I discovered a
somewhat strange behaviour of namei():
If called for a DOT directory ("." or "...path/.") it returns with
nd.ni_dvp == nd.ni_vp
Even if called with LOCKPARENT flag both (identical) vnodes are not locked.
This leads to a bunch of code like
if (nd.ni_dvp == nd.ni_vp)
Is there a reason why the parent directory (nd.ni_dvp) is returned unlocked?
If the parent directory was locked this code would become as simple as
Juergen Hannken-Illjes - email@example.com - TU Braunschweig (Germany)