diff options
author | Matthew Ahrens <[email protected]> | 2013-11-22 15:13:18 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-12-06 09:30:51 -0800 |
commit | 384f8a09f8423d951bb81d9ca945e588de14f95f (patch) | |
tree | ecc453b3d1561ac9952a418e5d4fc8db9002568f /module/zfs/zfs_dir.c | |
parent | 729210564a5325e190fc4fba22bf17bacf957ace (diff) |
Illumos #4347 ZPL can use dmu_tx_assign(TXG_WAIT)
Fix a lock contention issue by allowing threads not holding
ZPL locks to block when waiting to assign a transaction.
Porting Notes:
zfs_putpage() still uses TXG_NOWAIT, unlike the upstream version. This
case may be a contention point just like zfs_write(), however it is not
safe to block here since it may be called during memory reclaim.
Reviewed by: George Wilson <[email protected]>
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Dan McDonald <[email protected]>
Reviewed by: Boris Protopopov <[email protected]>
Approved by: Dan McDonald <[email protected]>
References:
https://www.illumos.org/issues/4347
illumos/illumos-gate@e722410c49fe67cbf0f639cbcc288bd6cbcf7dd1
Ported-by: Ned Bass <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'module/zfs/zfs_dir.c')
-rw-r--r-- | module/zfs/zfs_dir.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/module/zfs/zfs_dir.c b/module/zfs/zfs_dir.c index 17c77d035..448a8727e 100644 --- a/module/zfs/zfs_dir.c +++ b/module/zfs/zfs_dir.c @@ -973,7 +973,6 @@ zfs_make_xattrdir(znode_t *zp, vattr_t *vap, struct inode **xipp, cred_t *cr) return (SET_ERROR(EDQUOT)); } -top: tx = dmu_tx_create(zsb->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -982,13 +981,8 @@ top: fuid_dirtied = zsb->z_fuid_dirty; if (fuid_dirtied) zfs_fuid_txhold(zsb, tx); - 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; - } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); return (error); |