Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Feb 2021 01:07:29 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: adf28ab45670 - main - fifo: minor comment and assert improvements.
Message-ID:  <202102120107.11C17Tvv070907@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=adf28ab45670329459aed8afeec2dbe91c9b3713

commit adf28ab45670329459aed8afeec2dbe91c9b3713
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-02-01 10:43:16 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-02-12 01:02:22 +0000

    fifo: minor comment and assert improvements.
    
    In particular, replace a note that reload through vget() is obsoleted,
    with explanation why this code is required.
    
    Reviewed by:    chs, mckusick
    Tested by:      pho
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
---
 sys/kern/vfs_syscalls.c | 3 ++-
 sys/ufs/ufs/ufs_vnops.c | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index aba3d62936bb..a51d693446e3 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1183,7 +1183,8 @@ kern_openat(struct thread *td, int fd, const char *path, enum uio_seg pathseg,
 	 * vnode operations here.
 	 */
 	if (fp->f_ops == &badfileops) {
-		KASSERT(vp->v_type != VFIFO, ("Unexpected fifo."));
+		KASSERT(vp->v_type != VFIFO,
+		    ("Unexpected fifo fp %p vp %p", fp, vp));
 		finit_vnode(fp, flags, NULL, &vnops);
 	}
 
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index e6a78c3655cc..301c583291d1 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -252,9 +252,10 @@ ufs_mknod(ap)
 		DIP_SET(ip, i_rdev, vap->va_rdev);
 	}
 	/*
-	 * Remove inode, then reload it through VFS_VGET so it is
-	 * checked to see if it is an alias of an existing entry in
-	 * the inode cache.  XXX I don't believe this is necessary now.
+	 * Remove inode, then reload it through VFS_VGET().  This is
+	 * needed to do further inode initialization, for instance
+	 * fifo, which was too early for VFS_VGET() done as part of
+	 * UFS_VALLOC().
 	 */
 	(*vpp)->v_type = VNON;
 	ino = ip->i_number;	/* Save this before vgone() invalidates ip. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102120107.11C17Tvv070907>