aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2016-11-01 12:47:19 +0000
committerAlexander Motin <mav@FreeBSD.org>2016-11-01 12:47:19 +0000
commit2d1d8f4c8ff5db3816c320f320a806fe6b083459 (patch)
treec79d3786f6989a2b5da3cda4d56bd066e19d0905
parenta457fab84c8a110ec72d99feb26e7964c1e9c532 (diff)
downloadsrc-2d1d8f4c8ff5db3816c320f320a806fe6b083459.tar.gz
src-2d1d8f4c8ff5db3816c320f320a806fe6b083459.zip
Pass to zvol_log_truncate() same sync values as to zvol_log_write().
Surplus marking of TX_TRUNCATE records as sync could result in putting them into ZIL before previous writes if ones were async. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=308169
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
index 4965dde36f43..afaf4ffb53e6 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c
@@ -1674,7 +1674,7 @@ zvol_strategy(struct bio *bp)
if (error != 0) {
dmu_tx_abort(tx);
} else {
- zvol_log_truncate(zv, tx, off, resid, B_TRUE);
+ zvol_log_truncate(zv, tx, off, resid, sync);
dmu_tx_commit(tx);
error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,
off, resid);
@@ -3118,9 +3118,9 @@ zvol_d_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct threa
{
zvol_state_t *zv;
rl_t *rl;
- off_t offset, length, chunk;
+ off_t offset, length;
int i, error;
- u_int u;
+ boolean_t sync;
zv = dev->si_drv2;
@@ -3158,15 +3158,17 @@ zvol_d_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct threa
dmu_tx_t *tx = dmu_tx_create(zv->zv_objset);
error = dmu_tx_assign(tx, TXG_WAIT);
if (error != 0) {
+ sync = FALSE;
dmu_tx_abort(tx);
} else {
- zvol_log_truncate(zv, tx, offset, length, B_TRUE);
+ sync = (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS);
+ zvol_log_truncate(zv, tx, offset, length, sync);
dmu_tx_commit(tx);
error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,
offset, length);
}
zfs_range_unlock(rl);
- if (zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS)
+ if (sync)
zil_commit(zv->zv_zilog, ZVOL_OBJ);
break;
case DIOCGSTRIPESIZE: