]> granicus.if.org Git - zfs/commitdiff
ztest: dmu_tx_assign() gets ENOSPC in spa_vdev_remove_thread()
authorMatthew Ahrens <mahrens@delphix.com>
Thu, 13 Jun 2019 15:48:43 +0000 (08:48 -0700)
committerTony Hutter <hutter2@llnl.gov>
Wed, 25 Sep 2019 18:27:47 +0000 (11:27 -0700)
When running zloop, we occasionally see the following crash:

    dmu_tx_assign(tx, TXG_WAIT) == 0 (0x1c == 0)
    ASSERT at ../../module/zfs/vdev_removal.c:1507:spa_vdev_remove_thread()/sbin/ztest(+0x89c3)[0x55faf567b9c3]

The error value 0x1c is ENOSPC.

The transaction used by spa_vdev_remove_thread() should not be able to
fail due to being out of space. i.e. we should not call
dmu_tx_hold_space().  This will allow the removal thread to schedule its
work even when the pool is low on space.  The "slop space" will provide
enough free space to sync out the txg.

Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
External-issue: DLPX-37853
Closes #8889

module/zfs/vdev_removal.c

index f2d18d9257bd3609712281d6a9a268f12139dacc..536a982eca2bcbf218a06d32d26fe1ac97de1b52 100644 (file)
@@ -1498,7 +1498,7 @@ spa_vdev_remove_thread(void *arg)
 
                        dmu_tx_t *tx =
                            dmu_tx_create_dd(spa_get_dsl(spa)->dp_mos_dir);
-                       dmu_tx_hold_space(tx, SPA_MAXBLOCKSIZE);
+
                        VERIFY0(dmu_tx_assign(tx, TXG_WAIT));
                        uint64_t txg = dmu_tx_get_txg(tx);