Print this page
2130 zvol DKIOCFREE uses nested DMU transactions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/zfs/zvol.c
          +++ new/usr/src/uts/common/fs/zfs/zvol.c
↓ open down ↓ 1697 lines elided ↑ open up ↑
1698 1698  
1699 1699                  rl = zfs_range_lock(&zv->zv_znode, df.df_start, df.df_length,
1700 1700                      RL_WRITER);
1701 1701                  tx = dmu_tx_create(zv->zv_objset);
1702 1702                  error = dmu_tx_assign(tx, TXG_WAIT);
1703 1703                  if (error != 0) {
1704 1704                          dmu_tx_abort(tx);
1705 1705                  } else {
1706 1706                          zvol_log_truncate(zv, tx, df.df_start,
1707 1707                              df.df_length, B_TRUE);
     1708 +                        dmu_tx_commit(tx);
1708 1709                          error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ,
1709 1710                              df.df_start, df.df_length);
1710      -                        dmu_tx_commit(tx);
1711 1711                  }
1712 1712  
1713 1713                  zfs_range_unlock(rl);
1714 1714  
1715 1715                  if (error == 0) {
1716 1716                          /*
1717 1717                           * If the write-cache is disabled or 'sync' property
1718 1718                           * is set to 'always' then treat this as a synchronous
1719 1719                           * operation (i.e. commit to zil).
1720 1720                           */
↓ open down ↓ 278 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX