From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C8F7C433E0 for ; Tue, 2 Feb 2021 08:06:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 520C964EAA for ; Tue, 2 Feb 2021 08:06:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbhBBIF7 (ORCPT ); Tue, 2 Feb 2021 03:05:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbhBBIFz (ORCPT ); Tue, 2 Feb 2021 03:05:55 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAD6DC061573; Tue, 2 Feb 2021 00:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=GXKqg1wRs9RGvWZ1qTCHS+IG1zrHxoDxyev40JGQz0I=; b=FvPEpVXTiLIYOeqFYYGPHgfynw qZSL+6qvKRod0FOYIr48Dq6CWFH57jO2SiQzmAeOgGPYaBReWQ7b9l5/ioC5fjYRq/7JZPFEFr1ff f9qVB+5NtXQGwCORhFaTCqwyqIgWBWEjFVAn1ng8LV0OyVptXLlr6VLjDSAD0GmKXLqjspJRraDOR M/hg4oywu3pbkaN9MmTWUO6NbeHYeDjHu2K74GV1nbyEQIhys+yPQi7HkpvggU8ishRP9vnkyM7Jo HKGXREw7QzRQDRUE/aAem5OqUUfgG7/wCszzhqhpzcBqGUr10QhObKSbsqpsAigK8aYyQKFTzXQrB cL2VrZpQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1l6qgO-00Eto6-7S; Tue, 02 Feb 2021 08:05:08 +0000 Date: Tue, 2 Feb 2021 08:05:08 +0000 From: Christoph Hellwig To: Theodore Ts'o Cc: Vinicius Tinti , Christoph Hellwig , Andreas Dilger , Nathan Chancellor , Nick Desaulniers , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH v2] ext4: Enable code path when DX_DEBUG is set Message-ID: <20210202080508.GA3550351@infradead.org> References: <20210201003125.90257-1-viniciustinti@gmail.com> <20210201124924.GA3284018@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Feb 01, 2021 at 12:13:52PM -0500, Theodore Ts'o wrote: > However, if there *is* a bug, having an early detection that the > representation invariant of the data structure has been violated can > be useful in root causing a bug. This would probably be clearer if > the code was pulled out into a separate function with comments > explaining that this is a rep invariant check. > > The main thing about DX_DEBUG right now is that it is **super** > verbose. Unwary users who enable it.... will be sorry. If we want to > make it to be a first-class feature enabled via CONFIG_EXT4_DEBUG, we > should convert all of the dx_trace calls to use pr_debug so they are > enabled only if dynamic debug enables those pr_debug() statements. > And this should absolutely be a separate patch. Yes. The problem with a non-Kconfig ifdef is that is is almost guaranteed to bitrot very fast, so you might as well just remove the code. The "if (0)", while ugly, at least ensures the code still actually is seen and checked by the compiler.