Print this page
4347 ZPL can use dmu_tx_assign(TXG_WAIT)
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zfs_dir.c
          +++ new/usr/src/uts/common/fs/zfs/zfs_dir.c
↓ open down ↓ 929 lines elided ↑ open up ↑
 930  930                  return (error);
 931  931  
 932  932          if ((error = zfs_acl_ids_create(zp, IS_XATTR, vap, cr, NULL,
 933  933              &acl_ids)) != 0)
 934  934                  return (error);
 935  935          if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) {
 936  936                  zfs_acl_ids_free(&acl_ids);
 937  937                  return (SET_ERROR(EDQUOT));
 938  938          }
 939  939  
 940      -top:
 941  940          tx = dmu_tx_create(zfsvfs->z_os);
 942  941          dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes +
 943  942              ZFS_SA_BASE_ATTR_SIZE);
 944  943          dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE);
 945  944          dmu_tx_hold_zap(tx, DMU_NEW_OBJECT, FALSE, NULL);
 946  945          fuid_dirtied = zfsvfs->z_fuid_dirty;
 947  946          if (fuid_dirtied)
 948  947                  zfs_fuid_txhold(zfsvfs, tx);
 949      -        error = dmu_tx_assign(tx, TXG_NOWAIT);
      948 +        error = dmu_tx_assign(tx, TXG_WAIT);
 950  949          if (error) {
 951      -                if (error == ERESTART) {
 952      -                        dmu_tx_wait(tx);
 953      -                        dmu_tx_abort(tx);
 954      -                        goto top;
 955      -                }
 956  950                  zfs_acl_ids_free(&acl_ids);
 957  951                  dmu_tx_abort(tx);
 958  952                  return (error);
 959  953          }
 960  954          zfs_mknode(zp, vap, tx, cr, IS_XATTR, &xzp, &acl_ids);
 961  955  
 962  956          if (fuid_dirtied)
 963  957                  zfs_fuid_sync(zfsvfs, tx);
 964  958  
 965  959  #ifdef DEBUG
↓ open down ↓ 125 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX