From owner-freebsd-fs@FreeBSD.ORG Wed Jul 21 20:25:42 2010 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF263106566B for ; Wed, 21 Jul 2010 20:25:41 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id C7FB08FC29 for ; Wed, 21 Jul 2010 20:25:41 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id o6LKPdpD068355; Wed, 21 Jul 2010 13:25:39 -0700 (PDT) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201007212025.o6LKPdpD068355@chez.mckusick.com> To: Jeremy Chadwick In-reply-to: <20100721091058.GA74971@icarus.home.lan> Date: Wed, 21 Jul 2010 13:25:39 -0700 From: Kirk McKusick Cc: "Mikhail T." , fs@freebsd.org Subject: Re: panic: handle_written_inodeblock: bad size 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: Wed, 21 Jul 2010 20:25:42 -0000 > Date: Wed, 21 Jul 2010 02:10:58 -0700 > From: Jeremy Chadwick > To: Kirk McKusick > Cc: "Mikhail T." , fs@freebsd.org > Subject: Re: panic: handle_written_inodeblock: bad size > > On Tue, Jul 20, 2010 at 02:47:51PM -0700, Jeremy Chadwick wrote: > > On Tue, Jul 20, 2010 at 10:57:09AM -0700, Jeremy Chadwick wrote: > > > On Tue, Jul 20, 2010 at 08:44:51AM -0700, Kirk McKusick wrote: > > > > You are on the right track with getting the filesystem information. > > > > Any place that one has an inode (say pointer ip), it is possible > > > > to get the filesystem information using ip->i_fs->fs_fsmnt. The > > > > mount point can also be found from the mount-point structure. > > > > > > [...] > > > The biggest problem (for me) is testing. I have no idea how to > > > trigger the error conditions in these functions. I assume it varies; > > > maybe through fsdb(8) or interactively dropping to DDB and forcing > > > the condition. > > > > > > I tend to do all of my work on this sort on a VM of FreeBSD (using > > > VMware Workstation), but if testing on bare metal is required I > > > have a testbed as well. > > > > I've written (what I believe to be) the first stage of getting this > > accomplished, and have been (slowly) testing each of the functions I > > modified in src/sys/ufs/ffs/ffs_softdep.c. > > [...] > > The diff so far, I think, is around 20KBytes. > > I finished preliminary testing tonight. There were two functions which > I couldn't verify work because I couldn't get the kernel to call them no > matter what I tried: > > softdep_setup_allocext() > request_cleanup() The softdep_setup_allocext() function is only called when you set external attributes such as ACL parameters (try setfacl(1)). The request_cleanup() function is only called when your kernel is memory stressed from too many filesystem operations. You might get it to trigger by using sysctl to cut debug.max_softdeps to say 5000 then try removing a tree with at least 10000 files in it. > All the other functions I modified were tested by moving the panic() > call near the top of the function and doing whatever was needed. > Sometimes mounting a filesystem was all that was required to trigger it, > other times I had to make a new filesystem + sync, or umount. In one > case I had to make a UFS1+SU filesystem. It's not a completely 100% > accurate test, hence "preliminary". :-) Sounds good. > I also fixed a couple cosmetical items with the code (things not lining > up right, some strings having ":" at the end of them when it should have > been within the initial formatting string itself, and one function which > used %s for "softdep" instead of just using the actual string itself). > These were few and far between. > > Below is the patch/diff for RELENG_8 I've come up with. I only tested > this on amd64: > > http://jdc.parodius.com/freebsd/ffs_softdep.c.patch > > Kirk, if you could review this I'd appreciate it. I have grabbed your patch and will look it over in the next few days. > -- > | Jeremy Chadwick jdc@parodius.com | > | Parodius Networking http://www.parodius.com/ | > | UNIX Systems Administrator Mountain View, CA, USA | > | Making life hard for others since 1977. PGP: 4BD6C0CB | Thanks for taking the time to go though all those panics! Kirk McKusick