Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Oct 2025 18:33:25 GMT
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 76157a63a0c6 - main - ddb show lockedvnods: avoid trap for ufs vnode under construction
Message-ID:  <202510011833.591IXPtQ040959@gitrepo.freebsd.org>

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

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

commit 76157a63a0c63dd7363f6c8ae60edc814b3c138a
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2025-10-01 18:25:27 +0000
Commit:     Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2025-10-01 18:25:27 +0000

    ddb show lockedvnods: avoid trap for ufs vnode under construction
    
    ddb show lockedvnods might find a ufs vnode after it is inserted into
    the mount queue in ffs_vgetf but before the dinode is allocated.  Avoid
    trapping by testing for the dinode pointer.
    
    Reviewed by:    markj
    Discussed with: mjg
    Sponsored by:   Dell Inc.
    Differential Revision:  https://reviews.freebsd.org/D52795
---
 sys/ufs/ufs/ufs_vnops.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 0921eee92b9d..736c5a66267e 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -2592,8 +2592,12 @@ ufs_print(
 
 	printf("\tnlink=%d, effnlink=%d, size=%jd", ip->i_nlink,
 	    ip->i_effnlink, (intmax_t)ip->i_size);
-	if (I_IS_UFS2(ip))
-		printf(", extsize %d", ip->i_din2->di_extsize);
+	if (I_IS_UFS2(ip)) {
+		if (ip->i_din2 == NULL)
+			printf(", dinode=NULL (fields omitted)");
+		else
+			printf(", extsize=%d", ip->i_din2->di_extsize);
+	}
 	printf("\n\tgeneration=%jx, uid=%d, gid=%d, flags=0x%b\n",
 	    (uintmax_t)ip->i_gen, ip->i_uid, ip->i_gid,
 	    (uint32_t)ip->i_flags, PRINT_INODE_FLAGS);



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