From owner-freebsd-current@freebsd.org Fri Dec 4 02:51:06 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0E05A40502 for ; Fri, 4 Dec 2015 02:51:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98F4D1C52 for ; Fri, 4 Dec 2015 02:51:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by wmww144 with SMTP id w144so47380545wmw.0 for ; Thu, 03 Dec 2015 18:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=ocFuxzloX4CvJjNe9N7GKCiSR3F62XLK+pxAPDCc/kk=; b=aWMUVIwaQYvbXZs4BYgs1t7cev6hd07ZuwcxxG3iZVq2Q0J83bhw4tTd6lgcbGmui4 vDrE8pa1DK73NeTxczZ7HNjEeNUUTWCRBXAdPeDXXRvanwt5M1MQmH35lRqvebXRf4+b m2y/9YFuumDWK2Wp5Hw7D7wQKbXu2NgVJirlPzh4Mso1JbU6F02PnxsyMEpTnUT5VbXX L0AoYOX+aDr1ct/CQMspbhmh1Ru7ME5Mbc2QaixxIIGjYB6vM5IfCxVeItpzyJ7McI4Q I7C3SaZh77hh3Wc/f+Wvq1wtcRKgbfdmkBoKuBZ2d3hNdsaU0foRP7rOSLKDrpTe2S1d dJCQ== X-Received: by 10.28.130.7 with SMTP id e7mr1945453wmd.68.1449197465069; Thu, 03 Dec 2015 18:51:05 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id m11sm1514242wma.5.2015.12.03.18.51.04 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 03 Dec 2015 18:51:04 -0800 (PST) Date: Fri, 4 Dec 2015 03:51:02 +0100 From: Mateusz Guzik To: Kirk McKusick Cc: Rick Macklem , FreeBSD Current Subject: Re: panic "ffs_checkblk: bad block" on recent -head kernels Message-ID: <20151204025102.GA15514@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Kirk McKusick , Rick Macklem , FreeBSD Current References: <20151203224752.GA19134@dft-labs.eu> <201512032307.tB3N7mMl001027@chez.mckusick.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201512032307.tB3N7mMl001027@chez.mckusick.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Dec 2015 02:51:07 -0000 On Thu, Dec 03, 2015 at 03:07:48PM -0800, Kirk McKusick wrote: > > Date: Thu, 3 Dec 2015 23:47:52 +0100 > > From: Mateusz Guzik > > To: Rick Macklem > > Cc: FreeBSD Current > > Subject: Re: panic "ffs_checkblk: bad block" on recent -head kernels > > > > On Thu, Dec 03, 2015 at 05:08:27PM -0500, Rick Macklem wrote: > >> Hi, > >> > >> I get a fairly reproducible panic when doing a full kernel build > >> on a 256Mbyte single core i386 when running recent kernels from -head. > >> > >> The panic is "ffs_checkblk: bad block ..". I don't actually have the > >> block # (although I think it's just 0xfffffffffffffff, given the backtrace), > >> because it runs off the screen. (I looked up the message via the debugger > >> from the first arg. to panic.) > >> > >> Here's the backtrace without all the numbers: > >> panic(c14f4b55, ffffffff, ffffffff, 0, 64,...) > >> ffs_checkblk(ffffffff, 8000, fffffff9c, ffffffff, c4a02454,...) > >> ffs_reallocblks > >> VOP_REALLOCBLKS_APV > >> cluster_write > >> ffs_write > >> VOP_WRITE_APV > >> vn_write > >> vn_io_fault_doio > >> vn_io_fault1 > >> vn_io_fault > >> dofilewrite > >> kern_writev > >> sys_write > >> syscall > >> > >> It doesn't happen on a kernel dated Sep. 30, but does happen on a Nov. 30 one. > >> (I was away from home, so I didn't upgrade kernels for 2 months.) > >> > >> I am slowly doing a binary search for the first kernel rev. where it occurs, > >> but since each build takes hours, it's going to take a while;-). > >> > >> At this point, it doesn't appear to happen on r289278 (just before jeff@'s buffer > >> cache patch). > >> With kernels between r289279-->r290480, I get into the "R" state that > >> was fixed by r290481 before I get a crash. > >> I tried reverting r289405 and r290047 from a recent kernel and the crashes still > >> occurred, so it doesn't appear to be these commits. > >> > >> I am currently testing r290481 to see if the crash occurs for this rev. > >> > >> If anyone has some insight into which commit might cause this, > >> please let me know. > > > > Well, did it crash with r291460 or later? > > > > If so, try the kernel just before that and if that helps, try: > > > > diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c > > index ff37de8..0ad6ef7 100644 > > --- a/sys/kern/vfs_subr.c > > +++ b/sys/kern/vfs_subr.c > > @@ -2783,6 +2783,7 @@ _vdrop(struct vnode *vp, bool locked) > > vp->v_op = NULL; > > #endif > > bzero(&vp->v_un, sizeof(vp->v_un)); > > + vp->v_lasta = vp->v_clen = vp->v_cstart = vp->v_lastw = 0; > > vp->v_iflag = 0; > > vp->v_vflag = 0; > > bo->bo_flag = 0; > > > > -- > > Mateusz Guzik > > I concur with trying this suggestion. starting with r291460 these > fields were no longer zero'ed when allocating the vnode. So you may > have some residual values in there that are causing trouble. I reviewed the rest of the structure, looks like this is the rest of the fallout. -- Mateusz Guzik