Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/specfs specfs(9): Attribute blame by stack trace ...



details:   https://anonhg.NetBSD.org/src/rev/435bacfc7197
branches:  trunk
changeset: 371870:435bacfc7197
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Oct 15 15:20:46 2022 +0000

description:
specfs(9): Attribute blame by stack trace for write to r/o medium.

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r bba4f14fa3e0 -r 435bacfc7197 sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Sat Oct 15 15:20:06 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Sat Oct 15 15:20:46 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.216 2022/10/15 15:20:46 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,11 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.215 2022/09/21 10:59:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.216 2022/10/15 15:20:46 riastradh Exp $");
+
+#ifdef _KERNEL_OPT
+#include "opt_ddb.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -86,6 +90,10 @@
 #include <miscfs/genfs/genfs.h>
 #include <miscfs/specfs/specdev.h>
 
+#ifdef DDB
+#include <ddb/ddb.h>
+#endif
+
 /*
  * Lock order:
  *
@@ -1485,6 +1493,9 @@
                        if (mp && (mp->mnt_flag & MNT_RDONLY)) {
                                printf("%s blk %"PRId64" written while ro!\n",
                                    mp->mnt_stat.f_mntonname, bp->b_blkno);
+#ifdef DDB
+                               db_stacktrace();
+#endif
                        }
                }
 #endif /* DIAGNOSTIC */



Home | Main Index | Thread Index | Old Index