]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Fix zap_update() ASSERT from ztest
authorTom Caputi <tcaputi@datto.com>
Fri, 14 Dec 2018 18:04:11 +0000 (13:04 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 14 Dec 2018 18:04:11 +0000 (10:04 -0800)
This patch simply removes an invalid assert from the zap_update()
function. The ASSERT is invalid because it does not hold the zap
lock from the time it fetches the old value to the time it confirms
that it is what it should be.

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #8209

module/zfs/zap_micro.c

index 920b529ca6bbf064badb42434e856fccc250bec5..8b4fd0652a1930628f2ef8d9e401bcbc31cefad4 100644 (file)
@@ -1283,19 +1283,8 @@ zap_update(objset_t *os, uint64_t zapobj, const char *name,
     int integer_size, uint64_t num_integers, const void *val, dmu_tx_t *tx)
 {
        zap_t *zap;
-       ASSERTV(uint64_t oldval);
        const uint64_t *intval = val;
 
-#ifdef ZFS_DEBUG
-
-       /*
-        * If there is an old value, it shouldn't change across the
-        * lockdir (eg, due to bprewrite's xlation).
-        */
-       if (integer_size == 8 && num_integers == 1)
-               (void) zap_lookup(os, zapobj, name, 8, 1, &oldval);
-#endif
-
        int err =
            zap_lockdir(os, zapobj, tx, RW_WRITER, TRUE, TRUE, FTAG, &zap);
        if (err != 0)
@@ -1322,7 +1311,6 @@ zap_update(objset_t *os, uint64_t zapobj, const char *name,
        } else {
                mzap_ent_t *mze = mze_find(zn);
                if (mze != NULL) {
-                       ASSERT3U(MZE_PHYS(zap, mze)->mze_value, ==, oldval);
                        MZE_PHYS(zap, mze)->mze_value = *intval;
                } else {
                        mzap_addent(zn, *intval);