Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp1819515rdf; Sun, 5 Nov 2023 16:02:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFURH+jkT6eNic0HQ5n7F5EuQEDE+IPxptv2wlqRwaTd16BLZsT2v0mPr064a1gVLclYsc+ X-Received: by 2002:a05:6e02:1ba1:b0:358:1f0:4c5c with SMTP id n1-20020a056e021ba100b0035801f04c5cmr33698916ili.32.1699228975120; Sun, 05 Nov 2023 16:02:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699228975; cv=none; d=google.com; s=arc-20160816; b=fEQmpNSW+DB8la4nmAp2QAhmtr05W13dBZIH9fccgJt2L4Ybb8cY35LxyEffqr/8bi vQMn/4CFxNENGCblS9kTnkBNI7svbENjIpXHk2uiDhkB9BzgWi3M8QewQadeiRVBPerx u96fuv+iPmC21j3iPGooG3BTg8V95oUy5b2VAX7MgJv/AanyzBXZAFUARL9cT4zHIkMJ M5ZA4q1NB37LYUaN/yXavewGVm9D1vRRylUaaojS885Sw7u2wS4Ab7w5ufq4xMP4Ztci QXW3YUhTknX0K9cDCGLLRgNc7bL4KZVT1aW7GQcy2oiyINs7qYbfnX/hgF8cZwf6ABnF v1Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=c/hC62UmMLmckVGDgZzDIEnoNTd1G4HUTJSEv/agGOY=; fh=eQxaXyAccT0YRLFruuNrc1KbqwfZbcuj2qX75n7tp3E=; b=Murt43Vm7kU79eG1Ys5f62tnr9QzX0muARrpyEkpg0dHX6/m3xL+QObnWTsqcFOiKr /by8n8ZLvsGQIgwQ+QIe86NCCm+2USU7GpBOMb8WzKLck1GalobmL7ijNljkrhcEBqfm Qhu18ooiBehR+PpqtLJqZYR29MHotEtzbEaBZvNwhziNHGnuZQ+CnR76FVL6wPqVt+NP IdafoU9S5tD/eLBALrHWl0aIg7NTxi4gg1THZBKLagdmmvAvhMjp99vCtWWhUwRM3RVV 9KxwMcj2GB3CBGeBFWqqsk/mxyZkZRGB3dkEQXSJVsq5Gr3dTKOBIJUeIM9HZJttn3eH KnJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=PaqyPKDC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s31-20020a056a00179f00b006c312564bdcsi6758409pfg.113.2023.11.05.16.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 16:02:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=PaqyPKDC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6D757805D5F8; Sun, 5 Nov 2023 16:02:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229949AbjKEX5t (ORCPT + 99 others); Sun, 5 Nov 2023 18:57:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKEX5s (ORCPT ); Sun, 5 Nov 2023 18:57:48 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB263C6 for ; Sun, 5 Nov 2023 15:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=c/hC62UmMLmckVGDgZzDIEnoNTd1G4HUTJSEv/agGOY=; b=PaqyPKDC1lSXJzaz4S+DW1xEuT EQrFonvTmByIwYZQdxpBft5a9c3q0quMjvGUuirTXJ3EfX6UUMldQl/tiPL4O3cADFVpzvzFSftk5 zn/TP7Fm2ZctPVGjiwz+zRoyOlvsBtOdixT0K/CTDLOMftnGHsoq9arZtpsw6lTlc9NUu1kuN8RD9 1ZWlB0A7RGYe+3XZGQ9qRsAmEXURykSqGPNNX3AX0l9utMbpWhi7L6gyYxyXHTuQvfKKlgGbsxIJf pF2DCOwytJFXNcgdu6OJexSkASm1YdoOmg/OyIXPLfbjohW6wDeUHqm2aTeT/YHih7awEDoBiW8Fg tARmilIA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1qzmzv-00BjoV-0A; Sun, 05 Nov 2023 23:57:43 +0000 Date: Sun, 5 Nov 2023 23:57:43 +0000 From: Al Viro To: Joey Pabalinas Cc: Linux Kernel Mailing List Subject: Re: [PATCH] fs: dlm: Remove impossible to hit if statement Message-ID: <20231105235743.GS1957730@ZenIV> References: <20231105231125.GR1957730@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231105231125.GR1957730@ZenIV> Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 05 Nov 2023 16:02:52 -0800 (PST) On Sun, Nov 05, 2023 at 11:11:25PM +0000, Al Viro wrote: > Sure, if you hit even a single iteration of that loop, you will > have memb guaranteed to be non-NULL. Therefore, to complete the > proof you only need to consider what happens if there is not > a single iteration. Which is to say, what happens if the list > is empty. Well, either memb is uninitialized, or there is an > intialization somewhere upstream. Declaration is not far before > that loop, and it is > struct dlm_member *memb = NULL; > Er... So for that change to be correct you need to show that > the list (ls->ls_nodes) can not be empty here. Unfortunately, > it looks like it very much can be empty, seeing that this > is apparently the only place where elements are added to > the list in question. So on the very first call it will > hit your "impossible to hit" case. Which leads to... > > * the patch had apparently never been tested. Looking at the uses of ->ls_nodes, I wonder if xarray would be a better fit here. Might be interesting to investigate...