Subject: Re: vop_symlink and unused vpp?
To: Konrad Schroder <perseant@hitl.washington.edu>
From: Assar Westerlund <assar@netbsd.org>
List: tech-kern
Date: 07/16/2001 23:03:49
Konrad Schroder <perseant@hitl.washington.edu> writes:
> LFS uses it; if it didn't exist, lfs_symlink would have to inline
> ufs_symlink in order to know whether the symlink succeeded or not, so it
> could know whether it had to take VDIROP off of a vnode or not.

I see.  And lfs cannot just check the return value from ufs_symlink
since it might have created the node and then failed to write the
contents of the symlink into a disk block.

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

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.

/assar