From owner-freebsd-fs@FreeBSD.ORG Wed Feb 20 00:42:52 2013 Return-Path: Delivered-To: freebsd-fs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ADEAB300 for ; Wed, 20 Feb 2013 00:42:52 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 5812536E for ; Wed, 20 Feb 2013 00:42:52 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r1K0gkk5048810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Feb 2013 16:42:46 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r1K0gklU048809 for freebsd-fs@FreeBSD.org; Tue, 19 Feb 2013 16:42:46 -0800 (PST) (envelope-from jmg) Date: Tue, 19 Feb 2013 16:42:46 -0800 From: John-Mark Gurney To: freebsd-fs@FreeBSD.org Subject: on zfs, read errors are considered write errors? Message-ID: <20130220004246.GL55866@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 19 Feb 2013 16:42:46 -0800 (PST) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Feb 2013 00:42:52 -0000 So, I've been trying to track down how ZFS handles errors and stuff to make sure it's sane before I try to fix geli, but I've been getting some wierd results... Apparently, zfs thinks that read errors are WRITE errors, or even CKSUM errors (this is understandable, as invalid data would cause a cksum error)... I don't know where in the zfs code that error accounting is happening, but here is my test: touch /root/disk{1,2} mdconfig -a -t vnode -f /root/disk1 -s 96m mdconfig -a -t vnode -f /root/disk2 -s 96m gnop create md0 gnop create md1 zpool create ztest mirror md0.nop md1.nop cd /ztest for i in `jot 1000 1`; do echo $i > $i; done cd / zpool export ztest gnop configure -r 0 md0.nop zpool import ztest zpool status gnop configure -r 30 md0.nop cat /ztest/* zpool status zpool scrub zpool status And I get results like: [root@carbon /]# zpool status pool: ztest state: ONLINE status: One or more devices has experienced an unrecoverable error. An attempt was made to correct the error. Applications are unaffected. action: Determine if the device needs to be replaced, and clear the errors using 'zpool clear' or replace the device with 'zpool replace'. see: http://illumos.org/msg/ZFS-8000-9P scan: scrub repaired 239K in 0h0m with 0 errors on Tue Feb 19 16:36:37 2013 config: NAME STATE READ WRITE CKSUM ztest ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 md0.nop ONLINE 5 277 422 md1.nop ONLINE 0 0 0 errors: No known data errors I'm patches that changes gnop to log the errors on debug of 1 instead of 2 (which also logs all requests), and the logs verify that only errors to READ requests are returned... Any clues why read errors would cause write errors? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."