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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 099B2C433FF for ; Fri, 2 Aug 2019 10:02:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE0C62067D for ; Fri, 2 Aug 2019 10:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564740140; bh=FjKxljAzNCZ8/Q1mr/jvpiOJoPO07xVhPRPdIySrwUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Rt6pZxvleAEJHqIdBBXFNwUHwtPgGpmSpgg6+HahUjP1q3mUUKBnxIibEpDZJPfr/ aRGTqoSWUrEPXyaj34k4i6/pqxGplgsSsPpf6pehtpfAVfMzTrHt6K+8InjGANGvwD 03qWuy02zKany6YU8rTyR0uCCSoW2cbbqTnKSpB0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404213AbfHBKCU (ORCPT ); Fri, 2 Aug 2019 06:02:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:45540 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404804AbfHBJmz (ORCPT ); Fri, 2 Aug 2019 05:42:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 08C5220679; Fri, 2 Aug 2019 09:42:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564738974; bh=FjKxljAzNCZ8/Q1mr/jvpiOJoPO07xVhPRPdIySrwUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kfDM2WM4TyPBEvllm2Npz6HE2++KHIvk9eIzVIyMbttixDIhIQ4RcyXFHIsJVoPuK 0N6bgWJSQeW6aVYM2jQ3+Ph2XAnnpWFJJBwLaJ2gx0JuM+uS4xFjW3UjMry7YGNrRt J+VvIk0HD0r9frAeslgUum39zid0/ZN1/0+S+seU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Thomas Gleixner , "H. Peter Anvin" , Borislav Petkov , Sasha Levin Subject: [PATCH 4.9 053/223] x86/build: Add set -e to mkcapflags.sh to delete broken capflags.c Date: Fri, 2 Aug 2019 11:34:38 +0200 Message-Id: <20190802092242.320495629@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190802092238.692035242@linuxfoundation.org> References: <20190802092238.692035242@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ Upstream commit bc53d3d777f81385c1bb08b07bd1c06450ecc2c1 ] Without 'set -e', shell scripts continue running even after any error occurs. The missed 'set -e' is a typical bug in shell scripting. For example, when a disk space shortage occurs while this script is running, it actually ends up with generating a truncated capflags.c. Yet, mkcapflags.sh continues running and exits with 0. So, the build system assumes it has succeeded. It will not be re-generated in the next invocation of Make since its timestamp is newer than that of any of the source files. Add 'set -e' so that any error in this script is caught and propagated to the build system. Since 9c2af1c7377a ("kbuild: add .DELETE_ON_ERROR special target"), make automatically deletes the target on any failure. So, the broken capflags.c will be deleted automatically. Signed-off-by: Masahiro Yamada Signed-off-by: Thomas Gleixner Cc: "H. Peter Anvin" Cc: Borislav Petkov Link: https://lkml.kernel.org/r/20190625072622.17679-1-yamada.masahiro@socionext.com Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/mkcapflags.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/mkcapflags.sh b/arch/x86/kernel/cpu/mkcapflags.sh index 6988c74409a8..711b74e0e623 100644 --- a/arch/x86/kernel/cpu/mkcapflags.sh +++ b/arch/x86/kernel/cpu/mkcapflags.sh @@ -3,6 +3,8 @@ # Generate the x86_cap/bug_flags[] arrays from include/asm/cpufeatures.h # +set -e + IN=$1 OUT=$2 -- 2.20.1