Subject: Re: CVS commit: src
To: None <source-changes@netbsd.org>
From: Bill Studenmund <skippy@macro.Stanford.EDU>
List: source-changes
Date: 04/07/1999 11:49:20
On Tue, 6 Apr 1999, Bill Studenmund wrote:
> Module Name: src
> Committed By: wrstuden
> Date: Wed Apr 7 05:47:37 UTC 1999
>
> Modified Files:
> src/sys/kern: vfs_lookup.c
> Log Message:
> Fix obscure bug in namei(), which was the cause of PR 7306.
>
> The problem is that if "sl" is a symbolic link, a lookup on "sl/" will
> be flagged as the last component. Thus VOP_LOOKUP will lock the parent
> directory. But when lookup() exits, ni_pathlen will be greater than one,
> as "/" is left in the name, and namei() would not unlock the parent. The
> next call to lookup() to resolve the symbolic link would fail as the parent
> was still locked.
Forgot to mention the parent locking only happens with LOCKPARENT set. So
this bug only gets tickled when looking up a path with a symbolic link
followed only by trailing slashes AND LOCKPARENT set.
Take care,
Bill