From owner-freebsd-current Wed Feb 23 14:35:40 2000 Delivered-To: freebsd-current@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id D950D37B9AF for ; Wed, 23 Feb 2000 14:35:30 -0800 (PST) (envelope-from iedowse@maths.tcd.ie) Received: from maccullagh.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 23 Feb 2000 22:35:29 +0000 (GMT) To: Matthew Dillon Cc: nops@maths.tcd.ie, freebsd-current@freebsd.org, diablo-list@list.bart.nl Subject: Re: ffs_blkfree: freeing free block (was Re: Panic (pmap)) In-reply-to: Your message of "Wed, 23 Feb 2000 12:53:11 PST." <200002232053.MAA31746@apollo.backplane.com> Date: Wed, 23 Feb 2000 22:35:29 +0000 From: Ian Dowse Message-ID: <200002232235.aa22335@salmon.maths.tcd.ie> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <200002232053.MAA31746@apollo.backplane.com>, Matthew Dillon writes: > There must still be a bug in there somewhere, unrelated to softupdates. > > Try turning off the vfs.ffs.doreallocblks via sysctl and see if that > stops the crashes, that will help narrow down where to search for the > problem. I think I've found it. Here's an easy way to repeat the problem to start with: mount_mfs -T fd1440 none /mnt cd /mnt dd if=/dev/zero bs=4k of=test seek=1036 count=1 dd if=/dev/zero bs=4k of=test1 count=1 dd if=/dev/zero bs=4k of=test2 rm test1 dd if=/dev/zero bs=4k of=test seek=8000 count=1 echo > test It looks as if the problem is in ffs_balloc(), and occurs as follows: - ffs_balloc() is asked to allocate a doubly indirect block. - The first-level indirection block already exists - The second-level indirection block does not exist, but is successfully allocated. - This block is linked into the first-level indirection block by the line: bap[indirs[i - 1].in_off] = nb; - Allocation of the data block fails. - All allocated blocks are then released, but there is still a link in the first-level indirection block to what is now a free block. The fix should be relatively straightforward - either the code should avoid linking new indirection blocks until all allocations succeed, or it should back out the changes on failure. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message