Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Aug 2011 11:28:33 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r224605 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201108021128.p72BSXjc048132@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Tue Aug  2 11:28:33 2011
New Revision: 224605
URL: http://svn.freebsd.org/changeset/base/224605

Log:
  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@
  Approved by:	re (kib)
  MFC after:	3 days

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	Tue Aug  2 11:24:42 2011	(r224604)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Tue Aug  2 11:28:33 2011	(r224605)
@@ -612,7 +612,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);
 
 	/*
@@ -6340,7 +6341,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?201108021128.p72BSXjc048132>