diff options
author | Brian Behlendorf <[email protected]> | 2014-07-21 10:19:25 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-07-22 09:41:38 -0700 |
commit | 7a8f0e80eae9053ebe6a3c5ce5f3360e8df8de2f (patch) | |
tree | 266827291076632f5e932d07d929bfb8800fcad6 | |
parent | 080b3100155c472f8c8a380db2458bf70bd13279 (diff) |
zfs_trunc() should use dmu_tx_assign(tx, TXG_WAIT)
As part of the write throttle & i/o schedule performance work the
zfs_trunc() function should have been updated to use TXG_WAIT.
Using TXG_WAIT ensures that the tx will be part of the next txg.
If TXG_NOWAIT is used and retried for ERESTART errors then the
tx can suffer from starvation.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ned Bass <[email protected]>
Closes #2488
-rw-r--r-- | module/zfs/zfs_znode.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index 23e090712..2d1ce93a7 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -1423,17 +1423,11 @@ zfs_trunc(znode_t *zp, uint64_t end) zfs_range_unlock(rl); return (error); } -top: tx = dmu_tx_create(zsb->z_os); dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_FALSE); zfs_sa_upgrade_txholds(tx, zp); - error = dmu_tx_assign(tx, TXG_NOWAIT); + error = dmu_tx_assign(tx, TXG_WAIT); if (error) { - if (error == ERESTART) { - dmu_tx_wait(tx); - dmu_tx_abort(tx); - goto top; - } dmu_tx_abort(tx); zfs_range_unlock(rl); return (error); |