From owner-freebsd-fs@FreeBSD.ORG Tue Nov 24 13:24:05 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 267A61065670 for ; Tue, 24 Nov 2009 13:24:05 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-bw0-f220.google.com (mail-bw0-f220.google.com [209.85.218.220]) by mx1.freebsd.org (Postfix) with ESMTP id A2AF38FC22 for ; Tue, 24 Nov 2009 13:24:04 +0000 (UTC) Received: by bwz20 with SMTP id 20so4934770bwz.14 for ; Tue, 24 Nov 2009 05:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=KGM0/rYR5Pxvp7O5gCD4/nEOQi8Tg9dhsAmnD/i3niI=; b=o3OcuxPAo1yd46V9AGomJvmYt9s7Sc9LOkqTt1P0kFneNWlzBLFIiyyjOzVg16X4L4 zpNOGeJoOjt7JCp1rsXKQabl8JBZd+hBbuUauygI5FJ6YkZN0d5HsmGEwq1CKjX0Mzb7 bADZqF8ANj5kCNhWMsxOee/qSJfnMqEshVuB0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=OqvjYO1YsTrh3rVsiwwpZbicnykk3vde607PR/hadCvSj4ISfSXAh+7XV2GMQI9l+g h5BMpmTVQ/u2KMvw3QKPHA9YsJUMjnUFn2ybsc373lfbA20zcMWr0dQ6D+/iaN+ycGQm ZByB5tF7NjF7Vtpe7ZkkIphhFlElXF/71qnn8= Received: by 10.204.33.194 with SMTP id i2mr6125257bkd.146.1259069043506; Tue, 24 Nov 2009 05:24:03 -0800 (PST) Received: from localhost (lan-78-157-90-54.vln.skynet.lt [78.157.90.54]) by mx.google.com with ESMTPS id z15sm7194246fkz.6.2009.11.24.05.24.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 24 Nov 2009 05:24:02 -0800 (PST) Date: Tue, 24 Nov 2009 15:23:57 +0200 From: Gleb Kurtsou To: Martin =?utf-8?Q?Sch=C3=BCtte?= Message-ID: <20091124132357.GA1941@tops.skynet.lt> References: <4B09EDB2.7020002@mschuette.name> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4B09EDB2.7020002@mschuette.name> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-fs@FreeBSD.org Subject: Re: [nullfs] [panic] null with unref'ed lowervp X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2009 13:24:05 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On (23/11/2009 03:04), Martin Schütte wrote: > Hello, > my server recently had the kernel panic "null with unref'ed lowervp" in > null_subr.c:null_checkvp(). > I am not sure whether I should open a PR for it. > > The system is a SMP machine with SCSI RAID (asr), it runs several jails > and uses multiple null mounts between partitions, because there is not > enough disk space (~90% usage). > > uname -a: > FreeBSD trinity.asta.uni-potsdam.de 7.2-RELEASE > FreeBSD 7.2-RELEASE #3: Tue May 12 18:53:06 CEST 2009 > root@trinity.asta.uni-potsdam.de:/usr/obj/usr/src/sys/ASTA i386 > > Kernel is compiled with: > options INVARIANT_SUPPORT > options INVARIANTS > options DIAGNOSTIC In my understanding null_checkvp assumptions doesn't hold in null_lock and null_unlock. So I'd suggest you running without DIAGNOSTIC or try attached patch instead. > Among the few occurances I was not able to observe a pattern or > reproduce the error (two crashes happened at 8am which is a cronjob > time, but not one with particulary high load). > I am also going to add new disks any time now in order to reduce the > number of null mounts, so I do not expect to see this error again. > > I append three gdb backtraces, in case anyone finds them useful. > > -- > Martin Schütte --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="nullfs-checkvp.patch.txt" diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index a028b63..4c0679f 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -553,7 +553,7 @@ null_lock(struct vop_lock1_args *ap) * lock as ffs has special lock considerations in it's * vop lock. */ - if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { + if (nn != NULL && (lvp = nn->null_lowervp) != NULL) { VI_LOCK_FLAGS(lvp, MTX_DUPOK); VI_UNLOCK(vp); /* @@ -622,7 +622,7 @@ null_unlock(struct vop_unlock_args *ap) mtxlkflag = 2; } nn = VTONULL(vp); - if (nn != NULL && (lvp = NULLVPTOLOWERVP(vp)) != NULL) { + if (nn != NULL && (lvp = nn->null_lowervp) != NULL) { VI_LOCK_FLAGS(lvp, MTX_DUPOK); flags |= LK_INTERLOCK; vholdl(lvp); --CE+1k2dSO48ffgeK--