Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/miscfs/kernfs Revert ticket 1367, it causes a kernel ...
details: https://anonhg.NetBSD.org/src/rev/7706c2b67013
branches: netbsd-6
changeset: 777106:7706c2b67013
user: bouyer <bouyer%NetBSD.org@localhost>
date: Sat Sep 03 11:36:03 2016 +0000
description:
Revert ticket 1367, it causes a kernel panic in test lib/libc/gen/t_getcwd
as seen in e.g.
http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/netbsd-6/i386/201608291710Z_anita.txt
lib/libc/gen/t_getcwd (206/500): 2 test cases
getcwd_err: [0.006614s] Passed.
getcwd_fts: uvm_fault(0xc0e221b0, 0, 1) -> 0xe
fatal page fault in supervisor mode
trap type 6 code 0 eip c023ba9f cs 9 eflags 10246 cr2 1c ilevel 0
panic: trap
cpu1: Begin traceback...
panic(c04616d0,cdcfb938,cdcfb938,c023ba9f,9,10246,1c,0,1c,0) at netbsd:panic+0x18
trap() at netbsd:trap+0xb51
--- trap (number 6) ---
kernfs_readdir(cdcfbc0c,1,c11ce0b4,c0439f60,c11ce0b4,cdcfbc58,c0cc0cc0,cdcfbc7c,0,0) at netbsd:kernfs_readdir+0x98f
VOP_READDIR(c11ce0b4,cdcfbc58,c0cc0cc0,cdcfbc7c,0,0,c19287e0,1,cdcfbc58,cdcfbc74) at netbsd:VOP_READDIR+0x68
vn_readdir(c14c3000,bb512000,0,1000,cdcfbcbc,c19287e0,0,0,c14c3000,0) at netbsd:vn_readdir+0xbd
sys___getdents30(c19287e0,cdcfbd00,cdcfbd28,186,bb516000,0,cdcfbd00,c1199bf4,2,bb7a4fe7) at netbsd:sys___getdents30+0x8c
syscall(cdcfbd48,bb6b00b3,ab,bf7f001f,bb6b001f,0,bb5010d0,bf7fe764,bb7c4be0,0) at netbsd:syscall+0xaa
cpu1: End traceback...
diffstat:
sys/miscfs/kernfs/kernfs_vnops.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
diffs (67 lines):
diff -r 8251d0f3ea09 -r 7706c2b67013 sys/miscfs/kernfs/kernfs_vnops.c
--- a/sys/miscfs/kernfs/kernfs_vnops.c Wed Aug 31 15:16:28 2016 +0000
+++ b/sys/miscfs/kernfs/kernfs_vnops.c Sat Sep 03 11:36:03 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kernfs_vnops.c,v 1.144.2.1 2016/08/27 13:13:31 bouyer Exp $ */
+/* $NetBSD: kernfs_vnops.c,v 1.144.2.2 2016/09/03 11:36:03 bouyer Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.144.2.1 2016/08/27 13:13:31 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.144.2.2 2016/09/03 11:36:03 bouyer Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -63,7 +63,6 @@
#include <miscfs/genfs/genfs.h>
#include <miscfs/kernfs/kernfs.h>
-#include <miscfs/specfs/specdev.h>
#ifdef IPSEC
#include <sys/mbuf.h>
@@ -860,11 +859,6 @@
vap->va_bytes = vap->va_size = DEV_BSIZE;
break;
- case KFSdevice:
- vap->va_nlink = 1;
- vap->va_rdev = ap->a_vp->v_rdev;
- break;
-
case KFSroot:
vap->va_nlink = 1;
vap->va_bytes = vap->va_size = DEV_BSIZE;
@@ -882,6 +876,7 @@
case KFSstring:
case KFShostname:
case KFSavenrun:
+ case KFSdevice:
case KFSmsgbuf:
#ifdef IPSEC
case KFSipsecsa:
@@ -1055,8 +1050,18 @@
if ((error = kernfs_allocvp(ap->a_vp->v_mount, &vp, kt->kt_tag, kt,
value)) != 0)
return error;
- kfs = VTOKERN(vp);
- d->d_fileno = kfs->kfs_fileno;
+ if (kt->kt_tag == KFSdevice) {
+ struct vattr va;
+
+ error = VOP_GETATTR(vp, &va, ap->a_cred);
+ if (error != 0) {
+ return error;
+ }
+ d->d_fileno = va.va_fileid;
+ } else {
+ kfs = VTOKERN(vp);
+ d->d_fileno = kfs->kfs_fileno;
+ }
vput(vp);
return 0;
}
Home |
Main Index |
Thread Index |
Old Index