NetBSD Problem Report #46088

From www@NetBSD.org  Fri Feb 24 16:30:42 2012
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id 9B1B763E15C
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 24 Feb 2012 16:30:42 +0000 (UTC)
Message-Id: <20120224163041.E9B7563E159@www.NetBSD.org>
Date: Fri, 24 Feb 2012 16:30:41 +0000 (UTC)
From: uklaus@hgb-leipzig.de
Reply-To: uklaus@hgb-leipzig.de
To: gnats-bugs@NetBSD.org
Subject: Diagnostic assertion failed in sys/fs/tmpfs/tmpfs_vnops.c
X-Send-Pr-Version: www-1.0

>Number:         46088
>Category:       kern
>Synopsis:       Diagnostic assertion failed in sys/fs/tmpfs/tmpfs_vnops.c
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    rmind
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 24 16:35:00 +0000 2012
>Closed-Date:    Fri Nov 08 15:58:34 +0000 2013
>Last-Modified:  Fri Nov 08 15:58:34 +0000 2013
>Originator:     Uwe Klaus
>Release:        6.0_BETA
>Organization:
>Environment:
NetBSD t410s 6.0_BETA NetBSD 6.0_BETA (GENERIC) #1: Fri Feb 24 10:25:25 MET 2012  root@t410s:/t410/inteldrm/obj.i386/sys/arch/i386/compile/GENERIC i386

>Description:
This is a follow-up of PR/46038.

make test in /usr/pkgsrc/devel/m4 causes kernel panic

savecore: kvm_read: invalid translation (invalid PTE)
savecore: reboot after panic: kernel diagnostic assertion "node->tn_spec.tn_dir.tn_parent == dnode" failed: file "/usr/src/sys/fs/tmpfs/tmpfs_vnops.c", line 2093 

make test succeeds for WRKOBJDIR on ffs file systems, but not for WRKOBJDIR on tmpfs.

cpu2: Begin traceback...
kern_assert() at netbsd:kern_assert+0x48
tmpfs_rmdir() at netbsd:tmpfs_rmdir+0x5ea
VOP_RMDIR() at netbsd:VOP_RMDIR+0x37
sys_rmdir() at netbsd:sys_rmdir+0xf2
syscall() at netbsd:syscall+0xca
cpu2: End traceback...
>How-To-Repeat:
mk.conf:    WRKOBJDIR=/tmp/pkgsrc
/etc/fstab: tmpfs /tmp tmpfs rw,-s=4G,nodev,nosuid

cd /usr/pkgsrc/devel/m4
make
make test

>Fix:

>Release-Note:

>Audit-Trail:
From: "Mindaugas Rasiukevicius" <rmind@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46088 CVS commit: src/sys/fs/tmpfs
Date: Fri, 8 Nov 2013 15:44:23 +0000

 Module Name:	src
 Committed By:	rmind
 Date:		Fri Nov  8 15:44:23 UTC 2013

 Modified Files:
 	src/sys/fs/tmpfs: tmpfs.h tmpfs_rename.c tmpfs_subr.c tmpfs_vfsops.c
 	    tmpfs_vnops.c

 Log Message:
 tmpfs: replace the broken tmpfs_dircookie() logic which uses the node
 address truncated to 31 bits (required for 32-bit readdir compatibility,
 e.g. linux32).  Instead, assign 2^31 range using the following logic:
 - The first half of the 2^31 is assigned incrementally (the fast path).
 - When exceeded, use the second half of 2^31, but manage with vmem(9).

 It will require 2 billion files per-directory to trigger vmem(9) usage.
 Also, while here, add some fixes for tmpfs_unmount().

 Should fix PR/47739, PR/47480, PR/46088 and PR/41068.
 Thanks to wiz@ for stress testing.


 To generate a diff of this commit:
 cvs rdiff -u -r1.45 -r1.46 src/sys/fs/tmpfs/tmpfs.h
 cvs rdiff -u -r1.4 -r1.5 src/sys/fs/tmpfs/tmpfs_rename.c
 cvs rdiff -u -r1.82 -r1.83 src/sys/fs/tmpfs/tmpfs_subr.c
 cvs rdiff -u -r1.52 -r1.53 src/sys/fs/tmpfs/tmpfs_vfsops.c
 cvs rdiff -u -r1.105 -r1.106 src/sys/fs/tmpfs/tmpfs_vnops.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->rmind
Responsible-Changed-By: rmind@NetBSD.org
Responsible-Changed-When: Fri, 08 Nov 2013 15:58:34 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->closed
State-Changed-By: rmind@NetBSD.org
State-Changed-When: Fri, 08 Nov 2013 15:58:34 +0000
State-Changed-Why:
Should be fixed in -current.  Please let us know if you will ever see a
similar problem again.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.