/* Sanity check, we shouldn't have any unchecked nodes */
                if (!upper->checked) {
-                       ASSERT(0);
+                       DEBUG_WARN("we should not have any unchecked nodes");
                        return -EUCLEAN;
                }
 
 
                break;
        case BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED:
        case BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED:
-               ASSERT(0);
+               DEBUG_WARN("unexpected STARTED ot SUSPENDED dev-replace state");
                ret = BTRFS_IOCTL_DEV_REPLACE_RESULT_ALREADY_STARTED;
                up_write(&dev_replace->rwsem);
                goto leave;
 
                 * using 0-order folios.
                 */
                if (unlikely(ret == -EAGAIN)) {
-                       ASSERT(0);
+                       DEBUG_WARN("folio order mismatch between new eb and filemap");
                        goto reallocate;
                }
                attached++;
 
        if (ret != 0) {
                btrfs_warn(fs_info, "missing free space info for %llu",
                           block_group->start);
-               ASSERT(0);
+               DEBUG_WARN();
                return ERR_PTR(-ENOENT);
        }
 
                return ret;
 
        if (ret == 0) {
-               ASSERT(0);
+               DEBUG_WARN();
                return -EIO;
        }
 
        if (p->slots[0] == 0) {
-               ASSERT(0);
+               DEBUG_WARN("no previous slot found");
                return -EIO;
        }
        p->slots[0]--;
                          "incorrect extent count for %llu; counted %u, expected %u",
                          block_group->start, extent_count,
                          expected_extent_count);
-               ASSERT(0);
+               DEBUG_WARN();
                ret = -EIO;
                goto out;
        }
                          "incorrect extent count for %llu; counted %u, expected %u",
                          block_group->start, extent_count,
                          expected_extent_count);
-               ASSERT(0);
+               DEBUG_WARN();
                ret = -EIO;
                goto out;
        }
 
        block_group = btrfs_lookup_block_group(trans->fs_info, start);
        if (!block_group) {
-               ASSERT(0);
+               DEBUG_WARN("no block group found for start=%llu", start);
                ret = -ENOENT;
                goto out;
        }
 
        block_group = btrfs_lookup_block_group(trans->fs_info, start);
        if (!block_group) {
-               ASSERT(0);
+               DEBUG_WARN("no block group found for start=%llu", start);
                ret = -ENOENT;
                goto out;
        }
                          "incorrect extent count for %llu; counted %u, expected %u",
                          block_group->start, extent_count,
                          expected_extent_count);
-               ASSERT(0);
+               DEBUG_WARN();
                ret = -EIO;
                goto out;
        }
                          "incorrect extent count for %llu; counted %u, expected %u",
                          block_group->start, extent_count,
                          expected_extent_count);
-               ASSERT(0);
+               DEBUG_WARN();
                ret = -EIO;
                goto out;
        }
 
         * reloc root without a corresponding root this could return ENOENT.
         */
        if (IS_ERR(root)) {
-               ASSERT(0);
+               DEBUG_WARN("error %ld reading root for reloc root", PTR_ERR(root));
                return PTR_ERR(root);
        }
        if (root->reloc_root != reloc_root) {
-               ASSERT(0);
+               DEBUG_WARN("unexpected reloc root found");
                btrfs_err(fs_info,
                          "root %llu has two reloc roots associated with it",
                          reloc_root->root_key.offset);
 
                result_string = "updated";
                break;
        case BTRFS_COMPARE_TREE_SAME:
-               ASSERT(0);
+               DEBUG_WARN("no change between trees");
                result_string = "unchanged";
                break;
        default:
-               ASSERT(0);
+               DEBUG_WARN("unexpected comparison result %d", result);
                result_string = "unexpected";
        }
 
 
                 * user having built with ASSERT enabled, so if ASSERT doesn't
                 * do anything we still error out.
                 */
-               ASSERT(0);
+               DEBUG_WARN("errr %ld reading chunk map at offset %llu",
+                          PTR_ERR(map), chunk_offset);
                return PTR_ERR(map);
        }
 
        lockdep_assert_held(&info->chunk_mutex);
 
        if (!alloc_profile_is_valid(type, 0)) {
-               ASSERT(0);
+               DEBUG_WARN("invalid alloc profile for type %llu", type);
                return ERR_PTR(-EINVAL);
        }
 
 
        if (!(type & BTRFS_BLOCK_GROUP_TYPE_MASK)) {
                btrfs_err(info, "invalid chunk type 0x%llx requested", type);
-               ASSERT(0);
+               DEBUG_WARN();
                return ERR_PTR(-EINVAL);
        }
 
 
        }
 
        /* All the zones are FULL. Should not reach here. */
-       ASSERT(0);
+       DEBUG_WARN("unexpected state, all zones full");
        return -EIO;
 }