]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Illumos #3955
authorMatthew Ahrens <mahrens@delphix.com>
Wed, 7 Aug 2013 18:32:46 +0000 (10:32 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 5 Nov 2013 20:16:14 +0000 (12:16 -0800)
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@be9000cc677e0a8d04e5be45c61d7370fc8c7b54

Ported-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #1775

cmd/ztest/ztest.c
module/zfs/dmu_tx.c

index 3b26f8d1eb75ab5745fb1ad523e89b5ff03c3085..0a7ca1c164aa82b8368a7a20ea0cda68befb89cb 100644 (file)
@@ -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);
index 7ee214bb0effb507a7f79700582e63e2bb1eb33e..5e4a5cbbe43a82eb14e1c5b1a09966a97960b4cc 100644 (file)
@@ -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 */