From owner-freebsd-stable@freebsd.org Mon Jul 11 13:33:05 2016 Return-Path: Delivered-To: freebsd-stable@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 0006DB83DB0 for ; Mon, 11 Jul 2016 13:33:04 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 C7C9A1EF1 for ; Mon, 11 Jul 2016 13:33:04 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 19c7d111-476c-11e6-8929-8ded99d5e9d7 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 11 Jul 2016 13:33:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u6BDWvaC003436; Mon, 11 Jul 2016 07:32:57 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1468243977.72182.118.camel@freebsd.org> Subject: Re: Not-so stable if you take a CAM error.... From: Ian Lepore To: Karl Denninger , freebsd-stable@freebsd.org Date: Mon, 11 Jul 2016 07:32:57 -0600 In-Reply-To: <6e9c07e1-12a6-a7cd-f775-6b0fe5a706bc@denninger.net> References: <2b0c454b-c1a0-4b5b-e778-bf0939e90ae1@denninger.net> <6e9c07e1-12a6-a7cd-f775-6b0fe5a706bc@denninger.net> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2016 13:33:05 -0000 On Mon, 2016-07-11 at 06:30 -0500, Karl Denninger wrote: > On 7/11/2016 02:57, Ronald Klop wrote: > > On Mon, 11 Jul 2016 02:54:38 +0200, Karl Denninger > > wrote: > > > > > Got a (nasty) surprise this afternoon on my sandbox machine. > > > > > > I was updating some Raspberry Pi2 machines which involved taking > > > the sd > > > card out, sticking it in an adapter and plugging it into the > > > sandbox, > > > then mounting the partition and using rsync. > > > > > > Unfortunately one of the cards was, unknown to me, bad and > > > returned a > > > write error during the update. > > > > > > The machine panic'd immediately after the CAM write error popped > > > up. > > > > > > I was quite surprised by this, since (1) the SD card was (of > > > course) > > > mounted as a UFS filesystem; it shows up as a CAM device, (2) the > > > machine itself is running off a ZFS root on a normal host-adapter > > > and > > > thus there is no comingling of the buffer cache and (3) there > > > were no > > > images being run from (can't, wrong architecture!) nor any system > > > I/O > > > (e.g. pagefile) going to the SD card. > > > > > > I certainly understand that under some circumstances (maybe even > > > most > > > circumstances) taking a hard I/O error to a system device is > > > going to > > > hose you and a panic() is arguably "least astonishment" when the > > > price > > > of being wrong might be a corrupted system file or worse (e.g. > > > corrupted > > > paged-out RSS, etc.) But I didn't expect a panic out a failed > > > write to > > > a device that is mounted and being used purely for data. > > > > > > I don't have a crash dump but can almost-certainly reproduce this > > > if > > > it's something that shouldn't happen and thus merits > > > investigation. > > > > > > > Hi, > > > > I understand you are surprised by this. I don't think it is the way > > it > > should work. > > Is there _any_ debugging information for people to use and try to > > help > > you? Like which FreeBSD version are you running? Which FreeBSD > > version > > was used to create the UFS fs? Does it use softupdates (SU) or also > > journaling (SU+J)? > > Maybe some output of dmesg? Or type of SD-card and reader. Other > > people might have similar problems with similar hardware. > > > > Regards, > > Ronald. > > > FreeBSD 11.0-BETA1 #0 r302489: Sat Jul 9 10:15:24 CDT 2016 > karl@NewFS.denninger.net:/usr/obj/usr/src/sys/KSD-SMP > > and > > FreeBSD 11.0-BETA1 #0 r302526: Sun Jul 10 10:39:31 CDT 2016 > karl@NewFS.denninger.net:/pics/CrossBuild/obj/arm.armv6/pics/CrossBui > ld/src/sys/RPI2 > > Both blew up in the same way when stimulated with same I/O error. > > The filesystem in question does have softupdates enabled (the RPI > images > have it turned on by default) but no journaling. It's not > card/reader > dependent no architecture dependent; when it occurred the first time > I > stuck the card and reader into one of my Pis and attempted to update > it > there (thinking that perhaps my sandbox machine's USB port was wonky) > and it blew up the Pi2 in the exact same way. > > This isn't (obviously, given both Intel-style and ARM machines being > involved) architecture dependent. > > It's been a good long while since I took an actual hard I/O error > that > was 'visible' at the OS level (I've had plenty of disks die on ZFS > over > last few years but no "double failures" on a mirror or similar, and I > on > my servers I haven't had a UFS-based system for a while. This > definitely looks like some sort of regression in the code; I've run > FreeBSD for a hell of a long time and have had plenty of instances > where > disks have failed without having the machine go out from under me. > Unfortunately, this is "just the way it works". A hard IO error while writing to a ufs filesystem with softupdates enabled will cause a panic, because the softupdates code doesn't handle that sort of failure, and the failure means that filesystem integrity is lost. The code has no idea how important the data is to the functioning of the system, no basis on which to decide whether to panic or not. -- Ian