Skip to content

Commit

Permalink
Illumos openzfs#3955
Browse files Browse the repository at this point in the history
3955 ztest failure: assertion refcount_count(&tx->tx_space_written) +
     delta <= tx->tx_space_towrite
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>

References:
  https://www.illumos.org/issues/3955
  illumos/illumos-gate@be9000c

Ported-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#1775
  • Loading branch information
ahrens authored and unya committed Dec 13, 2013
1 parent 2f46e64 commit 9ecfcc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions cmd/ztest/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -3715,6 +3715,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
else
dmu_tx_hold_write(tx, bigobj, bigoff, bigsize);

/* This accounts for setting the checksum/compression. */
dmu_tx_hold_bonus(tx, bigobj);

txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
if (txg == 0) {
umem_free(packbuf, packsize);
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/dmu_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,12 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, uint64_t off, uint64_t len)
blkid = off >> dn->dn_datablkshift;
nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift;

if (blkid >= dn->dn_maxblkid) {
if (blkid > dn->dn_maxblkid) {
rw_exit(&dn->dn_struct_rwlock);
return;
}
if (blkid + nblks > dn->dn_maxblkid)
nblks = dn->dn_maxblkid - blkid;
nblks = dn->dn_maxblkid - blkid + 1;

}
l0span = nblks; /* save for later use to calc level > 1 overhead */
Expand Down

0 comments on commit 9ecfcc7

Please sign in to comment.