Re: VFS vgone(l) manpage vs. code

2020-08-02 Thread Tim van der Molen
Schreilechner, Dominik (2020-07-30 11:35 +):
> > From: Jason McIntyre, Mittwoch, 29. Juli 2020 14:23
> >
> > On Wed, Jul 29, 2020 at 11:37:03AM +, Schreilechner, Dominik wrote:
> > > Hi,
> > >
> > > I noticed, that the description of vgone/vgonel in the manpage does not 
> > > match the \
> > > code. The manpage (https://man.openbsd.org/vgone) states:
> > > The difference between vgone() and vgonel() is that vgone() locks the 
> > > vnode \
> > > interlock and then calls vgonel() while vgonel() expects the interlock to 
> > > already \
> > > be locked.
> > > However, vgone simply calls vgonel with curproc (see vfs_subr.c).
> > > void
> > > vgone(struct vnode *vp)
> > > {
> > > struct proc *p = curproc;
> > > vgonel(vp, p);
> > > }
> > >
> > > Best regards,
> > > Dominik
> > >
> >
> > hi.
> >
> > it would be easier to get things improved if you attached a diff
> > describing what you think is correct. even failing a diff, a piece of
> > text saying what you think it should be would increase your chances.
> >
> > jmc
> 
> Sorry, I was not sure about that, but worst case I am wrong, I guess.
> Below is a diff of the man page, that describes the current difference 
> between vgone and vgonel as it is in the code.

We ended up committing a somewhat different diff. Thank you for
reporting!



Re: VFS vgone(l) manpage vs. code

2020-07-30 Thread Schreilechner, Dominik
> From: Jason McIntyre, Mittwoch, 29. Juli 2020 14:23
>
> On Wed, Jul 29, 2020 at 11:37:03AM +, Schreilechner, Dominik wrote:
> > Hi,
> >
> > I noticed, that the description of vgone/vgonel in the manpage does not 
> > match the \
> > code. The manpage (https://man.openbsd.org/vgone) states:
> > The difference between vgone() and vgonel() is that vgone() locks the vnode 
> > \
> > interlock and then calls vgonel() while vgonel() expects the interlock to 
> > already \
> > be locked.
> > However, vgone simply calls vgonel with curproc (see vfs_subr.c).
> > void
> > vgone(struct vnode *vp)
> > {
> > struct proc *p = curproc;
> > vgonel(vp, p);
> > }
> >
> > Best regards,
> > Dominik
> >
>
> hi.
>
> it would be easier to get things improved if you attached a diff
> describing what you think is correct. even failing a diff, a piece of
> text saying what you think it should be would increase your chances.
>
> jmc

Sorry, I was not sure about that, but worst case I am wrong, I guess.
Below is a diff of the man page, that describes the current difference between 
vgone and vgonel as it is in the code.

Best regards,
Dominik

diff --git a/share/man/man9/vgone.9 b/share/man/man9/vgone.9
index 3a663b582df..b3436fd9148 100644
--- a/share/man/man9/vgone.9
+++ b/share/man/man9/vgone.9
@@ -49,17 +49,13 @@ prepare a vnode for reuse by another file system.
 The preparation includes the cleaning of all file system specific data and
 the removal from its mount point vnode list.
 .Pp
-The difference between
 .Fn vgone
-and
-.Fn vgonel
-is that
-.Fn vgone
-locks the vnode interlock and then calls
-.Fn vgonel
-while
+is the same as
 .Fn vgonel
-expects the interlock to already be locked.
+with
+.Fa p
+set to the current process. Historically, vgonel was called with a locked vnode
+interlock, but that lock was removed.
 .Sh SEE ALSO
 .Xr vclean 9 ,
 .Xr vnode 9 ,



Re: VFS vgone(l) manpage vs. code

2020-07-29 Thread Jason McIntyre
On Wed, Jul 29, 2020 at 11:37:03AM +, Schreilechner, Dominik wrote:
> Hi,
> 
> I noticed, that the description of vgone/vgonel in the manpage does not match 
> the code.
> The manpage (https://man.openbsd.org/vgone) states:
> The difference between vgone() and vgonel() is that vgone() locks the vnode 
> interlock and then calls vgonel() while vgonel() expects the interlock to 
> already be locked.
> 
> However, vgone simply calls vgonel with curproc (see vfs_subr.c).
> void
> vgone(struct vnode *vp)
> {
> struct proc *p = curproc;
> vgonel(vp, p);
> }
> 
> Best regards,
> Dominik
> 

hi.

it would be easier to get things improved if you attached a diff
describing what you think is correct. even failing a diff, a piece of
text saying what you think it should be would increase your chances.

jmc



VFS vgone(l) manpage vs. code

2020-07-29 Thread Schreilechner, Dominik
Hi,

I noticed, that the description of vgone/vgonel in the manpage does not match 
the code.
The manpage (https://man.openbsd.org/vgone) states:
The difference between vgone() and vgonel() is that vgone() locks the vnode 
interlock and then calls vgonel() while vgonel() expects the interlock to 
already be locked.

However, vgone simply calls vgonel with curproc (see vfs_subr.c).
void
vgone(struct vnode *vp)
{
struct proc *p = curproc;
vgonel(vp, p);
}

Best regards,
Dominik