git: 487cee4ddc7d - stable/13 - ddb: do not assume that ffs is mounted with softdep

From: Eric van Gyzen <vangyzen_at_FreeBSD.org>
Date: Thu, 03 Mar 2022 14:20:42 UTC
The branch stable/13 has been updated by vangyzen:

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

commit 487cee4ddc7dd51cc8a3963ca08259fbe3dc686d
Author:     Keith Owens <keith.owens2@dell.com>
AuthorDate: 2021-08-25 01:59:31 +0000
Commit:     Eric van Gyzen <vangyzen@FreeBSD.org>
CommitDate: 2022-03-03 14:20:07 +0000

    ddb: do not assume that ffs is mounted with softdep
    
    Avoid a panic when debugging with "show ffs" in ddb.
    
    Reviewed By:    kib, markj, mckusick
    MFC after:      1 week
    Sponsored by:   Dell EMC Isilon
    Differential Revision: https://reviews.freebsd.org/D31622
    
    (cherry picked from commit 3b29c8b4bdb0e396d7bb5d0760f11d7fa4208c84)
---
 sys/ufs/ffs/ffs_softdep.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 37709b605fbd..d8b143d9d816 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -15006,9 +15006,15 @@ db_print_ffs(struct ufsmount *ump)
 {
 	db_printf("mp %p (%s) devvp %p\n", ump->um_mountp,
 	    ump->um_mountp->mnt_stat.f_mntonname, ump->um_devvp);
-	db_printf("    fs %p su_wl %d su_deps %d su_req %d\n",
-	    ump->um_fs, ump->softdep_on_worklist,
-	    ump->softdep_deps, ump->softdep_req);
+	db_printf("    fs %p ", ump->um_fs);
+
+	if (ump->um_softdep != NULL) {
+		db_printf("su_wl %d su_deps %d su_req %d\n",
+		    ump->softdep_on_worklist, ump->softdep_deps,
+		    ump->softdep_req);
+	} else {
+		db_printf("su disabled\n");
+	}
 }
 
 static void