Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jul 2009 15:15:58 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195822 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200907221515.n6MFFwpd044856@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <jh at saunalahti dot fi>
  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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907221515.n6MFFwpd044856>