From owner-freebsd-current@FreeBSD.ORG Mon Apr 13 17:55:14 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E5B61065673; Mon, 13 Apr 2009 17:55:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6BD388FC08; Mon, 13 Apr 2009 17:55:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3BC7146B4C; Mon, 13 Apr 2009 13:55:12 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2D4DB8A052; Mon, 13 Apr 2009 13:54:51 -0400 (EDT) From: John Baldwin To: Norikatsu Shigemura Date: Mon, 13 Apr 2009 13:04:43 -0400 User-Agent: KMail/1.9.7 References: <49BD117B.2080706@163.com> <012d01c9b706$ccace720$6606b560$@Sparrevohn@btinternet.com> <20090409003108.fe768d54.nork@FreeBSD.org> In-Reply-To: <20090409003108.fe768d54.nork@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200904131304.43585.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Mon, 13 Apr 2009 13:54:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=4.2 tests=RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Thomas Sparrevohn , freebsd-current@freebsd.org, 'Damian Gerow' Subject: Re: ZFS checksum errors on USB attach (Was: ZFS data error without reasons) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2009 17:55:14 -0000 On Wednesday 08 April 2009 11:31:08 am Norikatsu Shigemura wrote: > Hi jhb! > > I got ZFS checksum error issue, too. So I found a way of fixing > this issue. Please back out following change. > > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > revision 1.5 > date: 2009/03/18 16:19:44; author: jhb; state: Exp; lines: +2 -0 > SVN rev 189967 on 2009-03-18 16:19:44Z by jhb > > The zfs_get_xattrdir() function is used to find the extended attribute > directory for a znode. When the directory already exists, it returns a > referenced but unlocked vnode. When a directory does not yet exist, it > calls zfs_make_xattrdir() to create a new one. zfs_make_xattrdir() returns > the vnode both referenced and and locked and zfs_get_xattrdir() was leaking > this vnode lock to its callers. Fix this by dropping the vnode lock if > zfs_make_xattrdir() successfully creates a new extended attribute > directory. > > Reviewed by: pjd > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > [Validation] > 1. I got ZFS checksum error issue > 2. Backup > 3. Restructure ZPool > 4. Restore (But ZFS checksum error) > 5. Restructure ZPool with kern.smp.disabled=1 > (Almost good, but...) > 6. Restore > 7. Backout zfs_dir#1.5 > 8. Good works for me > > I tested many backup&restore:-). I have no idea how this would break what you are seeing. The zfs_get_xattrdir() function is only called from zfs_lookup() when LOOKUP_XATTR is specified, and that only happens from the extended attribute VOP routines. Are you using extended attributes at all? Also, have you tried running with INVARIANTS and DEBUG_VFS_LOCKS to catch missing locks? -- John Baldwin