Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/miscfs/specfs Add a diagnostic test for buffers written ...
details: https://anonhg.NetBSD.org/src/rev/9dd597a5024e
branches: trunk
changeset: 351851:9dd597a5024e
user: hannken <hannken%NetBSD.org@localhost>
date: Wed Mar 01 10:46:05 2017 +0000
description:
Add a diagnostic test for buffers written to a block device holding
a read-only mounted file system.
This will become a KASSERT in the near future.
diffstat:
sys/miscfs/specfs/spec_vnops.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r effb5f590155 -r 9dd597a5024e sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c Wed Mar 01 10:45:24 2017 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c Wed Mar 01 10:46:05 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spec_vnops.c,v 1.168 2017/01/02 10:33:28 hannken Exp $ */
+/* $NetBSD: spec_vnops.c,v 1.169 2017/03/01 10:46:05 hannken Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.168 2017/01/02 10:33:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.169 2017/03/01 10:46:05 hannken Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@@ -1053,6 +1053,16 @@
bp->b_dev = dev;
if (!(bp->b_flags & B_READ)) {
+#ifdef DIAGNOSTIC
+ if (bp->b_vp && bp->b_vp->v_type == VBLK) {
+ struct mount *mp = spec_node_getmountedfs(bp->b_vp);
+
+ if (mp && (mp->mnt_flag & MNT_RDONLY)) {
+ printf("%s blk %"PRId64" written while ro!\n",
+ mp->mnt_stat.f_mntonname, bp->b_blkno);
+ }
+ }
+#endif /* DIAGNOSTIC */
error = fscow_run(bp, false);
if (error)
goto out;
Home |
Main Index |
Thread Index |
Old Index