NetBSD Problem Report #45276

From www@NetBSD.org  Sat Aug 20 09:59:57 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id EB0DA63CDA2
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 20 Aug 2011 09:59:56 +0000 (UTC)
Message-Id: <20110820095955.D6DFE63CD9F@www.NetBSD.org>
Date: Sat, 20 Aug 2011 09:59:55 +0000 (UTC)
From: gnrp@komkon2.de
Reply-To: gnrp@komkon2.de
To: gnats-bugs@NetBSD.org
Subject: vnodeops(9) has small typo; does not mention vfs renamelock; does not mention locking state
X-Send-Pr-Version: www-1.0

>Number:         45276
>Category:       kern
>Synopsis:       vnodeops(9) has small typo; does not mention vfs renamelock; does not mention locking state
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dholland
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 20 10:00:01 +0000 2011
>Closed-Date:    Mon Jul 21 06:07:20 +0000 2014
>Last-Modified:  Mon Jul 21 06:07:20 +0000 2014
>Originator:     Julian Fagir
>Release:        NetBSD-current
>Organization:
>Environment:
>Description:
1. vnodeops(9) has a small typo (vp instead of dvp).

2. VOP_GETATTR can be called either locked or unlocked, that should be mentioned.
sys/fs/union/union_vnops.c reports that.

3. The caller of VOP_RENAME  needs to hold the rename lock of its vfs to rename the file.
>How-To-Repeat:
man 9 vnodeops
>Fix:
--- ./share/man/man9/vnodeops.9.orig    2011-08-11 23:09:36.000000000 +0200
+++ ./share/man/man9/vnodeops.9 2011-08-11 23:14:43.000000000 +0200
@@ -135,7 +135,7 @@
 .Fn VOP_SEEK "struct vnode *vp" "off_t oldoff" "off_t newoff" \
 "kauth_cred_t cred"
 .Ft int
-.Fn VOP_REMOVE "struct vnode *vp" "struct vnode *vp" \
+.Fn VOP_REMOVE "struct vnode *dvp" "struct vnode *vp" \
 "struct componentname *cnp"
 .Ft int
 .Fn VOP_LINK "struct vnode *dvp" "struct vnode *vp" \
@@ -565,6 +565,8 @@
 .Fa vap .
 Attributes which are not available are set to the value VNOVAL.
 .Pp
+Note that the vnode can be either locked or unlocked.
+.Pp
 For more information on vnode attributes see
 .Xr vattr 9 .
 .It Fn VOP_SETATTR "vp" "vap" "cred"
@@ -852,6 +854,13 @@
 The target directory and file vnodes should both be locked on entry.
 .Fn VOP_RENAME
 updates the reference counts prior to returning.
+.Pp
+The caller of
+.Fn VOP_RENAME
+must hold the vfs renamelock aquired by
+.Fn VFS_RENAMELOCK_ENTER
+and exited by
+.Fn VFS_RENAMELOCK_EXIT .
 .It Fn VOP_MKDIR "dvp" "vpp" "cnp" "vap"
 Make a new directory in a given directory.
 The argument

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: kern-bug-people->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Thu, 08 Dec 2011 22:18:26 +0000
Responsible-Changed-Why:
mine


From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45276 CVS commit: src/share/man/man9
Date: Mon, 21 Jul 2014 05:56:26 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Mon Jul 21 05:56:26 UTC 2014

 Modified Files:
 	src/share/man/man9: vnodeops.9

 Log Message:
 Adjustments based on suggestions from gnrp in PR 45276:
  - fix argument names of VOP_REMOVE
  - mention deprecated behavior of calling VOP_GETATTR unlocked
  - mention rename lock


 To generate a diff of this commit:
 cvs rdiff -u -r1.93 -r1.94 src/share/man/man9/vnodeops.9

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 21 Jul 2014 06:07:20 +0000
State-Changed-Why:
similar changes committed


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.