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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 A130CC3A5AB for ; Thu, 5 Sep 2019 12:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A3732080C for ; Thu, 5 Sep 2019 12:27:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389360AbfIEM1R (ORCPT ); Thu, 5 Sep 2019 08:27:17 -0400 Received: from aws.guarana.org ([13.237.110.252]:58206 "EHLO aws.guarana.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387820AbfIEM1Q (ORCPT ); Thu, 5 Sep 2019 08:27:16 -0400 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Thu, 05 Sep 2019 08:27:15 EDT Received: by aws.guarana.org (Postfix, from userid 1006) id DCE0CBBED4; Thu, 5 Sep 2019 12:17:55 +0000 (UTC) Date: Thu, 5 Sep 2019 12:17:55 +0000 From: Kevin Easton To: Al Viro Cc: Christoph Hellwig , Qian Cai , linux-fsdevel@vger.kernel.org, LKML , Linus Torvalds Subject: Re: "fs/namei.c: keep track of nd->root refcount status" causes boot panic Message-ID: <20190905121755.GA23258@ip-172-31-14-16> References: <7C6CCE98-1E22-433C-BF70-A3CBCDED4635@lca.pw> <20190903123719.GF1131@ZenIV.linux.org.uk> <20190903130456.GA9567@infradead.org> <20190903134832.GH1131@ZenIV.linux.org.uk> <20190903135024.GA8274@infradead.org> <20190903135354.GI1131@ZenIV.linux.org.uk> <20190903153930.GA2791@infradead.org> <20190903175610.GM1131@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190903175610.GM1131@ZenIV.linux.org.uk> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 03, 2019 at 06:56:10PM +0100, Al Viro wrote: > On Tue, Sep 03, 2019 at 08:39:30AM -0700, Christoph Hellwig wrote: > > > > There's much nastier situation than "new upstream kernel released, > > > need to rebuild" - it's bisect in mainline trying to locate something... > > > > I really don't get the point. And it's not like we've card about > > this anywhere else. And jumping wildly around with the numeric values > > for constants will lead to bugs like the one you added and fixed again > > and again. > > The thing is, there are several groups - it's not as if all additions > were guaranteed to be at the end. So either we play with renumbering > again and again, or we are back to the square one... > > Is there any common trick that would allow to verify the lack of duplicates > at the build time? What about: static_assert( (LOOKUP_FOLLOW^LOOKUP_DIRECTORY^LOOKUP_AUTOMOUNT^LOOKUP_EMPTY^LOOKUP_DOWN^ LOOKUP_REVAL^LOOKUP_RCU^ LOOKUP_OPEN^LOOKUP_CREATE^LOOKUP_EXCL^LOOKUP_RENAME_TARGET^ LOOKUP_PARENT^LOOKUP_NO_REVAL^LOOKUP_JUMPED^LOOKUP_ROOT^LOOKUP_ROOT_GRABBED) == (LOOKUP_FOLLOW|LOOKUP_DIRECTORY|LOOKUP_AUTOMOUNT|LOOKUP_EMPTY|LOOKUP_DOWN| LOOKUP_REVAL|LOOKUP_RCU| LOOKUP_OPEN|LOOKUP_CREATE|LOOKUP_EXCL|LOOKUP_RENAME_TARGET| LOOKUP_PARENT|LOOKUP_NO_REVAL|LOOKUP_JUMPED|LOOKUP_ROOT|LOOKUP_ROOT_GRABBED) , "duplicated LOOKUP_* constant"); ? - Kevin