From patchwork Sun Dec 5 17:49:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 12657179 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D95CC433FE for ; Sun, 5 Dec 2021 17:49:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236689AbhLERxU (ORCPT ); Sun, 5 Dec 2021 12:53:20 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:56210 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbhLERxU (ORCPT ); Sun, 5 Dec 2021 12:53:20 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8991261125 for ; Sun, 5 Dec 2021 17:49:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8282C00446; Sun, 5 Dec 2021 17:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638726591; bh=WDJDLIk/LkLaM+Ecib9/ncGiij1a5lrVGtqKC4eIDOw=; h=Date:From:To:Cc:Subject:From; b=d/1wdzsmOcv9ztvNDkeJnmFK/Wfp01Xy33vigFeamTv7XcIRp1+j0/7lDPkErTIZN ChGdbPmZcgrb1zVq59BjVJjKG6j0471B9TabWiAC2DRN9wvN1065y4LzxjBljNvWGg fXD4930u5xvLB/jWKVQnXGENoRLETDCoF3jEBdAcAwOpKu6Khwg4uItw+2pb/owZai +Cjis1tNZh1YCdfkPhiufFzZMNmdAOhCei3UUk/YfnT9x0B8yUzuGDBNT9bPzK3nZf 3GlXRkziqJpwPrsLVHE+afSBUUtScmDciWzWZa0ADCcWvEKcCgCBQZABxRaeS3wqVE Wrw8WGJ0acDNw== Date: Sun, 5 Dec 2021 09:49:51 -0800 From: "Darrick J. Wong" To: Eric Sandeen Cc: Thomas Goirand , 1000974@bugs.debian.org, Giovanni Mascellani , xfslibs-dev@packages.debian.org, xfs , gustavoars@kernel.org, keescook@chromium.org Subject: [PATCH xfsprogs-5.14.2 URGENT] libxfs: hide the drainbamaged fallthrough macro from xfslibs Message-ID: <20211205174951.GQ8467@magnolia> MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Back in mid-2021, Kees and Gustavo rammed into the kernel a bunch of static checker "improvements" that redefined '/* fallthrough */' comments for switch statements as a macro that virtualizes either that same comment, a do-while loop, or a compiler __attribute__. This was necessary to work around the poor decision-making of the clang, gcc, and C language standard authors, who collectively came up with four mutually incompatible ways to document a lack of branching in a code flow. Having received ZERO HELP porting this to userspace, Eric and I foolishly dumped that crap into linux.h, which was a poor decision because we keep forgetting that linux.h is exported as a userspace header. This has now caused downstream regressions in Debian[1] and will probably cause more problems in the other distros. Move it to platform_defs.h since that's not shipped publicly and leave a warning to anyone else who dare modify linux.h. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1000974 Fixes: df9c7d8d ("xfs: Fix fall-through warnings for Clang") Cc: 1000974@bugs.debian.org, gustavoars@kernel.org, keescook@chromium.org Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Eric Sandeen --- include/linux.h | 20 ++------------------ include/platform_defs.h.in | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/include/linux.h b/include/linux.h index 24650228..054117aa 100644 --- a/include/linux.h +++ b/include/linux.h @@ -360,24 +360,8 @@ fsmap_advance( #endif /* HAVE_MAP_SYNC */ /* - * Add the pseudo keyword 'fallthrough' so case statement blocks - * must end with any of these keywords: - * break; - * fallthrough; - * continue; - * goto