From owner-svn-src-head@FreeBSD.ORG Wed Jul 22 15:15:59 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1644D1065670; Wed, 22 Jul 2009 15:15:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03A5E8FC24; Wed, 22 Jul 2009 15:15:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6MFFwIe044858; Wed, 22 Jul 2009 15:15:58 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6MFFwpd044856; Wed, 22 Jul 2009 15:15:58 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200907221515.n6MFFwpd044856@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 22 Jul 2009 15:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195822 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jul 2009 15:15:59 -0000 Author: trasz Date: Wed Jul 22 15:15:58 2009 New Revision: 195822 URL: http://svn.freebsd.org/changeset/base/195822 Log: Fix extattr_list_file(2) on ZFS in case the attribute directory doesn't exist and user doesn't have write access to the file. Without this fix, it returns bogus value instead of 0. For some reason this didn't manifest on my kernel compiled with -O0. PR: kern/136601 Submitted by: Jaakko Heinonen Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 22 14:37:53 2009 (r195821) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 22 15:15:58 2009 (r195822) @@ -4722,6 +4722,9 @@ vop_listextattr { ZFS_ENTER(zfsvfs); + if (sizep != NULL) + *sizep = 0; + error = zfs_lookup(ap->a_vp, NULL, &xvp, NULL, 0, ap->a_cred, td, LOOKUP_XATTR); if (error != 0) { @@ -4752,9 +4755,6 @@ vop_listextattr { auio.uio_rw = UIO_READ; auio.uio_offset = 0; - if (sizep != NULL) - *sizep = 0; - do { u_char nlen;