Subject: Re: vop_symlink and unused vpp?
To: Assar Westerlund <assar@netbsd.org>
From: Konrad Schroder <perseant@hitl.washington.edu>
List: tech-kern
Date: 07/16/2001 14:34:02
On 16 Jul 2001, Assar Westerlund wrote:

> What should really happen if ufs_symlink fails to write out the
> contents of the symlink?  Isn't symlink() supposed to be an atomic
> operation?  It would seem that it would leave a bad symlink.  If
> changing it to that is the right thing, then lfs_symlink should be
> able to just examine the return value from ufs_symlink.

The only interesting question from an LFS point of view is whether the
vnode was created or not, regardless of whether ufs_symlink as a whole
succeeded.  If vnodes are created with VDIROP (always true of newly
allocated files) and not accounted for with UNMARK_VNODE(), the filesystem
would eventually wedge waiting for those already-completed dirops to
complete.

> a) document that VOP_SYMLINK always gets *a_vpp = NULL in and can
> choose to set it or not, but that it should be vrefed if != NULL.  ufs
> can always set it, thereby making lfs happy
>
> b) remove it, and let lfs call a special ufs function instead of the
> vnode operation
>
> c) fix existing file systems to return the created vnode in a_vpp

Any of these alternatives look fine to me, and perhaps (b)  just means
inlining ufs_symlink into lfs_symlink.  (a) is the easiest, being just a
doc change, without any associated code changes, right?

------------------------------------------------------------------------
Konrad Schroder          http://www.hitl.washington.edu/people/perseant/
Information Tech & Services   Box 352142 -or- 215 Fluke Hall, Mason Road
Human Interface Technology Lab                  University of Washington
Voice: 206.616.1478   FAX: 206.543.5380          Seattle, WA, 98195, USA