From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 14 08:21:40 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38C0EB31 for ; Sat, 14 Jun 2014 08:21:40 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0812A8D for ; Sat, 14 Jun 2014 08:21:39 +0000 (UTC) Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id A645520DD7 for ; Sat, 14 Jun 2014 04:21:38 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sat, 14 Jun 2014 04:21:38 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:content-type:content-transfer-encoding; s=smtpout; bh=w /18nhwXQqahmOoE+104uZaCIXw=; b=HN6nM21Ax5U5HY0FN30PAAk5buEFRMqKX fFf8/IAvNpfDZON8M6XZKx+c3HwbbO5IOc2VR9GcjgMMVp3M3etIt8Zg3mUynOVE /aj+6ZgNUTpMuJGkPWaTx4riwCWlUXwE/GlrAuZUyb8iAVf3P68tDpVF0DHTFjWx HFwrSw/vYY= X-Sasl-enc: 3V9qQF+o2Knnjl7rm9Xtbx88FpttrG5uR6y6Mv+G7x67 1402734098 Received: from [192.168.1.31] (unknown [203.206.138.26]) by mail.messagingengine.com (Postfix) with ESMTPA id F35A46800F7 for ; Sat, 14 Jun 2014 04:21:37 -0400 (EDT) Message-ID: <539C0610.9080204@freebsd.org> Date: Sat, 14 Jun 2014 18:21:36 +1000 From: Darren Reed User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Subject: freebsd 10.0 reboot loop with ffs dup alloc X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jun 2014 08:21:40 -0000 I've just been through an interesting little scenario where my FreeBSD box was in a reboot loop due to an error in the FFS log leading to it replaying data that led to apanic: ffs_valloc: dup alloc At this point, if I had not of been paying attention, FreeBSD would have continued to reboot forever as the panic happened when it was writing out a crash dump - well after fsck had marked the filesystem clean. The fix was to reboot into single user mode, not to replay the log, and let fsck do what it normally does. Unfortunately when the log is present, using "-y" means that the log is replayed thus forcing "-y" to not being used and "y" being manually entered for all of the answers :-/ Something like the patch below should be used where the answer to the "USE JOURNAL" question is not subject to the "-y" setting. I suppose another bug here is that the journal ended up with some sort of corruption or bad data inside of it that led to it recreating a situation on disk that would later cause a panic. Cheers, Darren *** main.c.orig Sat Jun 14 18:15:52 2014 --- main.c Sat Jun 14 18:16:50 2014 *************** *** 400,406 **** */ if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { ! if (preen || reply("USE JOURNAL")) { if (suj_check(filesys) == 0) { printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); if (chkdoreload(mntp) == 0) --- 400,415 ---- */ if ((sblock.fs_flags & FS_SUJ) == FS_SUJ) { if ((sblock.fs_flags & FS_NEEDSFSCK) != FS_NEEDSFSCK && skipclean) { ! int yf = yflag; ! int rep; ! ! yflag = 0; ! if (!preen) ! rep = reply("USE JOURNAL"); ! else ! rep = 0; ! yflag = yf; ! if (preen || rep) { if (suj_check(filesys) == 0) { printf("\n***** FILE SYSTEM MARKED CLEAN *****\n"); if (chkdoreload(mntp) == 0)