Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Aug 2011 07:34:11 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224959 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201108180734.p7I7YBVu042383@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Thu Aug 18 07:34:11 2011
New Revision: 224959
URL: http://svn.freebsd.org/changeset/base/224959

Log:
  MFC r224605:
  Fix panic in zfs_read() if IO_SYNC flag supplied by checking for
  zfsvfs->z_log before calling zil_commit(). [1]
  Do not call zfs_read() from zfs_getextattr() with the IO_SYNC flag.
  
  Submitted by:	Alexander Zagrebin <alex@zagrebin.ru> [1]
  Reviewed by:	pjd

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Aug 18 04:44:41 2011	(r224958)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Thu Aug 18 07:34:11 2011	(r224959)
@@ -618,7 +618,8 @@ zfs_read(vnode_t *vp, uio_t *uio, int io
 	/*
 	 * If we're in FRSYNC mode, sync out this znode before reading it.
 	 */
-	if (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS)
+	if (zfsvfs->z_log &&
+	    (ioflag & FRSYNC || zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS))
 		zil_commit(zfsvfs->z_log, zp->z_id);
 
 	/*
@@ -6345,7 +6346,7 @@ vop_getextattr {
 		if (error == 0)
 			*ap->a_size = (size_t)va.va_size;
 	} else if (ap->a_uio != NULL)
-		error = VOP_READ(vp, ap->a_uio, IO_UNIT | IO_SYNC, ap->a_cred);
+		error = VOP_READ(vp, ap->a_uio, IO_UNIT, ap->a_cred);
 
 	VOP_UNLOCK(vp, 0);
 	vn_close(vp, flags, ap->a_cred, td);



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