usr/src/uts/common/fs/zfs/zvol.c
changeset 4391 ddb512bd7379
parent 4107 5b13dedb1ea7
child 4543 12bb2876a62e
--- a/usr/src/uts/common/fs/zfs/zvol.c	Tue Jun 05 14:43:15 2007 -0700
+++ b/usr/src/uts/common/fs/zfs/zvol.c	Tue Jun 05 15:22:48 2007 -0700
@@ -802,7 +802,6 @@
 	objset_t *os;
 	rl_t *rl;
 	int error = 0;
-	int sync;
 	boolean_t reading;
 
 	if (zv == NULL) {
@@ -829,7 +828,6 @@
 
 	os = zv->zv_objset;
 	ASSERT(os != NULL);
-	sync = !(bp->b_flags & B_ASYNC) && !(zil_disable);
 
 	bp_mapin(bp);
 	addr = bp->b_un.b_addr;
@@ -876,7 +874,7 @@
 	if ((bp->b_resid = resid) == bp->b_bcount)
 		bioerror(bp, off > volsize ? EINVAL : error);
 
-	if (sync)
+	if (!(bp->b_flags & B_ASYNC) && !reading && !zil_disable)
 		zil_commit(zv->zv_zilog, UINT64_MAX, ZVOL_OBJ);
 
 	biodone(bp);