summaryrefslogtreecommitdiff
path: root/usr/src/cmd/ztest/ztest.c
diff options
context:
space:
mode:
authorNeil Perrin <Neil.Perrin@Sun.COM>2010-06-25 15:50:31 -0600
committerNeil Perrin <Neil.Perrin@Sun.COM>2010-06-25 15:50:31 -0600
commit5002558f6bfef3915c7f3b4ecb7c19c7f044bf5b (patch)
tree3569fdb74156028ab7ae831e9bf87758df2e0f83 /usr/src/cmd/ztest/ztest.c
parent688a63ed70eca66e1dc82c8f096cb66f8bd94013 (diff)
downloadillumos-joyent-5002558f6bfef3915c7f3b4ecb7c19c7f044bf5b.tar.gz
6913010 assertion failed: error||lr->lr_length <= zp->z_blksz, file: ../../common/fs/zfs/zfs_vnops.c
6620948 slow progress with stress tests 6478419 Should push all synchronous transactions in zil_commit_writer() 6916723 ZIL: Unnecessary scanning of the intent log tx chain. 6598837 zil_commit() might wait unnecessarily 6535172 zil_sync causing long hold times on zl_lock 6916703 ZIL: race on setting z_last_itx 6579989 zl_lock hold time can still be improved
Diffstat (limited to 'usr/src/cmd/ztest/ztest.c')
-rw-r--r--usr/src/cmd/ztest/ztest.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/usr/src/cmd/ztest/ztest.c b/usr/src/cmd/ztest/ztest.c
index bd015ed287..acd647c45c 100644
--- a/usr/src/cmd/ztest/ztest.c
+++ b/usr/src/cmd/ztest/ztest.c
@@ -1102,7 +1102,7 @@ ztest_bt_bonus(dmu_buf_t *db)
#define lrz_bonustype lr_rdev
#define lrz_bonuslen lr_crtime[1]
-static uint64_t
+static void
ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
{
char *name = (void *)(lr + 1); /* name follows lr */
@@ -1110,40 +1110,41 @@ ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
itx_t *itx;
if (zil_replaying(zd->zd_zilog, tx))
- return (0);
+ return;
itx = zil_itx_create(TX_CREATE, sizeof (*lr) + namesize);
bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
sizeof (*lr) + namesize - sizeof (lr_t));
- return (zil_itx_assign(zd->zd_zilog, itx, tx));
+ zil_itx_assign(zd->zd_zilog, itx, tx);
}
-static uint64_t
-ztest_log_remove(ztest_ds_t *zd, dmu_tx_t *tx, lr_remove_t *lr)
+static void
+ztest_log_remove(ztest_ds_t *zd, dmu_tx_t *tx, lr_remove_t *lr, uint64_t object)
{
char *name = (void *)(lr + 1); /* name follows lr */
size_t namesize = strlen(name) + 1;
itx_t *itx;
if (zil_replaying(zd->zd_zilog, tx))
- return (0);
+ return;
itx = zil_itx_create(TX_REMOVE, sizeof (*lr) + namesize);
bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
sizeof (*lr) + namesize - sizeof (lr_t));
- return (zil_itx_assign(zd->zd_zilog, itx, tx));
+ itx->itx_private = (void *)object;
+ zil_itx_assign(zd->zd_zilog, itx, tx);
}
-static uint64_t
+static void
ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write_t *lr)
{
itx_t *itx;
itx_wr_state_t write_state = ztest_random(WR_NUM_STATES);
if (zil_replaying(zd->zd_zilog, tx))
- return (0);
+ return;
if (lr->lr_length > ZIL_MAX_LOG_DATA)
write_state = WR_INDIRECT;
@@ -1166,37 +1167,39 @@ ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write_t *lr)
bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
sizeof (*lr) - sizeof (lr_t));
- return (zil_itx_assign(zd->zd_zilog, itx, tx));
+ zil_itx_assign(zd->zd_zilog, itx, tx);
}
-static uint64_t
+static void
ztest_log_truncate(ztest_ds_t *zd, dmu_tx_t *tx, lr_truncate_t *lr)
{
itx_t *itx;
if (zil_replaying(zd->zd_zilog, tx))
- return (0);
+ return;
itx = zil_itx_create(TX_TRUNCATE, sizeof (*lr));
bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
sizeof (*lr) - sizeof (lr_t));
- return (zil_itx_assign(zd->zd_zilog, itx, tx));
+ itx->itx_sync = B_FALSE;
+ zil_itx_assign(zd->zd_zilog, itx, tx);
}
-static uint64_t
+static void
ztest_log_setattr(ztest_ds_t *zd, dmu_tx_t *tx, lr_setattr_t *lr)
{
itx_t *itx;
if (zil_replaying(zd->zd_zilog, tx))
- return (0);
+ return;
itx = zil_itx_create(TX_SETATTR, sizeof (*lr));
bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
sizeof (*lr) - sizeof (lr_t));
- return (zil_itx_assign(zd->zd_zilog, itx, tx));
+ itx->itx_sync = B_FALSE;
+ zil_itx_assign(zd->zd_zilog, itx, tx);
}
/*
@@ -1328,7 +1331,7 @@ ztest_replay_remove(ztest_ds_t *zd, lr_remove_t *lr, boolean_t byteswap)
VERIFY3U(0, ==, zap_remove(os, lr->lr_doid, name, tx));
- (void) ztest_log_remove(zd, tx, lr);
+ (void) ztest_log_remove(zd, tx, lr, object);
dmu_tx_commit(tx);
@@ -2045,7 +2048,7 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
{
zilog_t *zilog = zd->zd_zilog;
- zil_commit(zilog, UINT64_MAX, ztest_random(ZTEST_OBJECTS));
+ zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
/*
* Remember the committed values in zd, which is in parent/child
@@ -5266,7 +5269,7 @@ ztest_freeze(ztest_shared_t *zs)
*/
while (BP_IS_HOLE(&zd->zd_zilog->zl_header->zh_log)) {
ztest_dmu_object_alloc_free(zd, 0);
- zil_commit(zd->zd_zilog, UINT64_MAX, 0);
+ zil_commit(zd->zd_zilog, 0);
}
txg_wait_synced(spa_get_dsl(spa), 0);
@@ -5293,7 +5296,7 @@ ztest_freeze(ztest_shared_t *zs)
/*
* Commit all of the changes we just generated.
*/
- zil_commit(zd->zd_zilog, UINT64_MAX, 0);
+ zil_commit(zd->zd_zilog, 0);
txg_wait_synced(spa_get_dsl(spa), 0);
/*