Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp114052pxj; Wed, 26 May 2021 17:50:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQ6sSv6ksqKiFvvhvk3Qd0paeqS8flqIU71c8fDMNfW+wSGhRgxkk7UCnwYOv+iER1m9pe X-Received: by 2002:a17:906:2894:: with SMTP id o20mr993002ejd.520.1622076615295; Wed, 26 May 2021 17:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622076615; cv=none; d=google.com; s=arc-20160816; b=VcL8yCrRUf11L+Me/EbruEbUpOMBN4BR83N2+b/ApqHkKsOMKM65Pl87SH+qyKXZcw fZuJWZLNAZwRKxjLQWSXUnuVq9zNYyPun/r3O4cxYL9/7iyiNM979/DanUy/G6n6EhDh Byy11XA0HoLf+h+mCc91pbgmIDKYIi5XZMUEFK79q/rCkvmfvQMa88DlLAD7O6K1regd TxoaGxtp3Y6GzMSVywM9P/NhxHCsLWZpxW0djL9LA6ugN8YCD2QWs3tHjd1yEvLZxPIU k2CWzaNpvkDRSNbkID44jUVP+8hSlJQt8imipjjJTadX/DUOkiG/8FR5PDQCuZ4Vm5tu 0Yiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZMakiGcIMDlZqGIzDPdb6xdhMN1BnnsGCHwzokfOMqE=; b=ZgDjHwS009wrVKnVHpsfZIIh8W1RlXzWPELStU8xIbNrv1x7Xe3bwimvYz/z8n/c86 8E6nxwEsri4daqCruxJg7XPciVsMxbUhUoK4wQWTLB69CLnbpKlJd0ux1tWyDTPOLHAy GLVOG4GWM6mUnKa7ZgoRh/DGMNcXpxuTyboInaAEaYzSVNWTORO0u67DMqlxm4ppAArz xsMgAnQdqXyagSHtZwNTddLmLSp2Pse1iljM3PMXD4RgTNacZ+3TisQ9S+rhWNOSFTy/ 0TGCRWt/XpEC6EMT+XtlCqBk/Z3q8tYoTY3szubNQGV62HBE4Ncxz9AQCuSPLh1WUdW2 kDyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hst1KNnU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si394042edc.289.2021.05.26.17.49.44; Wed, 26 May 2021 17:50:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hst1KNnU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233464AbhEZVR5 (ORCPT + 99 others); Wed, 26 May 2021 17:17:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:40750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233321AbhEZVR4 (ORCPT ); Wed, 26 May 2021 17:17:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A76261157; Wed, 26 May 2021 21:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622063784; bh=uEXIFI+L4SKigKIAweO/cjr41FgRtohujauek92fRok=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hst1KNnUY9lcj3qT6j5XE+yamkkUaMR14Ud4rB+OHolTQ1bf4NxrqlqUq99GcZuw2 HmpIsXDBVvZpkrw0r2QFTo+pikM5CBKb+bwUqkEHE90GU78c6ohwT1Us81C5vaCahI TodFvqBrlZKP0CMBkCUgS9+/2fti+S15SSo+enyp3vcYupHrfpH2Q+OKyGQZHR5hxb cwk+ZIjZ7aWTZlidE39HU5Kxoo6Yo870MdqrQWsehiMplHRn8x+mSNOyc2eivUKexg HqGaJAHBakhfRF3fJoTk3wUTLGkeQyWPobFq1GUWBWnqUuVtyP7iahyhLhiNN9Fbt0 /POv0zkmAlloA== Date: Wed, 26 May 2021 14:16:24 -0700 From: "Darrick J. Wong" To: "Gustavo A. R. Silva" Cc: "Gustavo A. R. Silva" , linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Kees Cook , joe@perches.com Subject: Re: [PATCH][next] xfs: Fix fall-through warnings for Clang Message-ID: <20210526211624.GB202121@locust> References: <20210420230652.GA70650@embeddedor> <20210420233850.GQ3122264@magnolia> <62895e8c-800d-fa7b-15f6-480179d552be@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 26, 2021 at 01:21:06PM -0500, Gustavo A. R. Silva wrote: > > > On 4/20/21 18:56, Gustavo A. R. Silva wrote: > > > > > > On 4/20/21 18:38, Darrick J. Wong wrote: > >> On Tue, Apr 20, 2021 at 06:06:52PM -0500, Gustavo A. R. Silva wrote: > >>> In preparation to enable -Wimplicit-fallthrough for Clang, fix > >>> the following warnings by replacing /* fall through */ comments, > >>> and its variants, with the new pseudo-keyword macro fallthrough: > >>> > >>> fs/xfs/libxfs/xfs_alloc.c:3167:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/libxfs/xfs_da_btree.c:286:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/libxfs/xfs_ag_resv.c:346:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/libxfs/xfs_ag_resv.c:388:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_bmap_util.c:246:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_export.c:88:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_export.c:96:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_file.c:867:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_ioctl.c:562:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_ioctl.c:1548:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_iomap.c:1040:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_inode.c:852:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_log.c:2627:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/xfs_trans_buf.c:298:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/bmap.c:275:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/btree.c:48:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/common.c:85:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/common.c:138:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/common.c:698:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/dabtree.c:51:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> fs/xfs/scrub/repair.c:951:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] > >>> > >>> Notice that Clang doesn't recognize /* fall through */ comments as > >>> implicit fall-through markings, so in order to globally enable > >>> -Wimplicit-fallthrough for Clang, these comments need to be > >>> replaced with fallthrough; in the whole codebase. > >>> > >>> Link: https://github.com/KSPP/linux/issues/115 > >>> Signed-off-by: Gustavo A. R. Silva > >> > >> I've already NAKd this twice, so I guess I'll NAK it a third time. > > > > Darrick, > > > > The adoption of fallthrough; has been already accepted and in use since Linux v5.7: > > > > https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through > > > > This change is needed, and I would really prefer if this goes upstream through your tree. > > > > Linus has taken these patches directly for a while, now. > > > > Could you consider taking it this time? :) > > > > Hi Darrick, > > If you don't mind, I will take this in my -next[1] branch for v5.14, so we can globally enable > -Wimplicit-fallthrough for Clang in that release. > > We had thousands of these warnings and now we are down to 47 in next-20210526, > 22 of which are fixed with this patch. I guess we're all required to kowtow to a bunch of effing bots now. Hooray for having to have a macro to code-switch for the sake of stupid compiler writers who refuse to give the rest of us a single workable way to signal "this switch code block should not end here": /* fall through */ __attribute__((fallthrough)); do { } while (0) /* fall through */ and soon the ISO geniuses will make it worse by adding to C2x: [[fallthrough]]; Hooray! Macros to abstractify stupidity!!!! Dave and I have told you and Miaohe several[1] times[2] to fix[3] the compiler, but clearly you don't care what we think and have decided to ram this in through Linus anyway. Since that is what you choose, do not send me email again. NAKed-by: Darrick J. Wong --D [1] https://lore.kernel.org/linux-xfs/20200820191237.GK6096@magnolia/ [2] https://lore.kernel.org/linux-xfs/20210420230652.GA70650@embeddedor/ [3] https://lore.kernel.org/linux-xfs/20200708065512.GN2005@dread.disaster.area/ > > Thanks > -- > Gustavo > > [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp