Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5536471pxj; Wed, 26 May 2021 12:58:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhtM3St79ifsWnvTRoyQNI5aphKwADfRnho/x6/lTYdkE+XAr2HfjPEs56B4HGlSA+NTUw X-Received: by 2002:a17:906:d922:: with SMTP id rn2mr6247ejb.469.1622059115868; Wed, 26 May 2021 12:58:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622059115; cv=none; d=google.com; s=arc-20160816; b=lW9aNG8uEB/2nz36JBJ1l163XJ/SrIPW8zvRp63mcXdWj/VAQkuBg59JIDcs9mxUen LECw75ymoqg2UUIbqUUFOgEYDX84D1bvM7XuOVUhK7UXpXB9p3xLINgEfqJaDst6045r qghcxeqzE1xTZonjHAT5cqduWvnp3YFV0TwWRHJMfbO0v8aTVr6Nkysfx2ZhgeM+4rwm 0EkDLOzBKlMVgQCyMu2Y7kbQ7j9iN1p9bAs8jnH2sN7qjROTxk3kYu88D6s6skc/rNR1 g4+IMZKYjRZ5A3McAIU6RmeOzgfZPOpk3HkFsNAmzUOuyqBZDSFouljohdRePcQqq57g 7tUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=HDHHVDIABje6bABsXVUlN331Ep4noo+DQ9eLJRToQC4=; b=aesWZsUAkIDurLj7T8N3c0C3D2idjpwMSVydHf3+PTEfuR92aXECWKlY2JhlJ9/Jbw Hd+lKPH5I6wivxoAxowmJNVJz+QCwm80t9ysznMNYgtrlh8QrL7YCUhIeJImXSrFjJ61 AZZmvk7ZTsPvfjTKi1giH16NkH0o+KgE63PlOd5zrKJQY2gt46AsSWqXWOMPr5MuvOe4 ey8IrzX76F4ODu0dPIta0NEej7wTt3hc7lXhg4vrD0cHZVCIbTHQ6dz0FV9r1pxhbh67 85yR4jVPoYlb2/ATqGY0crd+kzrRSTASMqJxC5GXffFtQ4lJlcTJwR1vc4nxEH0asqgx Dj/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=fkI2TXjB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce5si370572edb.102.2021.05.26.12.58.10; Wed, 26 May 2021 12:58:35 -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=fail header.i=@embeddedor.com header.s=default header.b=fkI2TXjB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235605AbhEZSqM (ORCPT + 99 others); Wed, 26 May 2021 14:46:12 -0400 Received: from gateway24.websitewelcome.com ([192.185.50.84]:23654 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234863AbhEZSqK (ORCPT ); Wed, 26 May 2021 14:46:10 -0400 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 414168630 for ; Wed, 26 May 2021 13:20:18 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id ly8glH1gGDedfly8glPOlH; Wed, 26 May 2021 13:20:18 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:Cc:To:From:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=HDHHVDIABje6bABsXVUlN331Ep4noo+DQ9eLJRToQC4=; b=fkI2TXjBxKC91M9xJGgzChXoeB 86+oMYnOFtHXnoNMPEJp6ro4Sb3SlFFYdK7aqFoJ4nLNGt/ZNCnkhWvWTqRUWSHQmD8ZB+WIOGL/d p9TDzoB9NYqFYbI0d0JYEVrES5QqF4TMLpBK9V2gAFYyG2ejhtq/eEVP+9KK6yIdmYwZ7OQD1DMaT 2xarFCv1JnpIRutt2M/Pe2Hm9dwhPKYLap31HY8qXIw9M9rvXQ3uGDjY9mSuYDGAQ8qVshe7e2caJ wf+2khl4bC1Q27xG57jIbRkR123ezsDrN/w/dnfKMF/PNl55J3ue537s0jluqbi6Pmwm0ODVQIBEa YVb9zydw==; Received: from 187-162-31-110.static.axtel.net ([187.162.31.110]:46184 helo=[192.168.15.8]) by gator4166.hostgator.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1lly8d-0049sR-OZ; Wed, 26 May 2021 13:20:15 -0500 Subject: Re: [PATCH][next] xfs: Fix fall-through warnings for Clang From: "Gustavo A. R. Silva" To: "Darrick J. Wong" , "Gustavo A. R. Silva" Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Kees Cook References: <20210420230652.GA70650@embeddedor> <20210420233850.GQ3122264@magnolia> <62895e8c-800d-fa7b-15f6-480179d552be@embeddedor.com> Message-ID: Date: Wed, 26 May 2021 13:21:06 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <62895e8c-800d-fa7b-15f6-480179d552be@embeddedor.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.162.31.110 X-Source-L: No X-Exim-ID: 1lly8d-0049sR-OZ X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 187-162-31-110.static.axtel.net ([192.168.15.8]) [187.162.31.110]:46184 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 4 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks -- Gustavo [1] https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=for-next/kspp