From patchwork Mon Sep 2 16:41:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 11126973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFB1015E9 for ; Mon, 2 Sep 2019 16:43:58 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BBC4621744 for ; Mon, 2 Sep 2019 16:43:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="iBqrsOSp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBC4621744 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4pOv-0000gv-5L; Mon, 02 Sep 2019 16:41:57 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i4pOt-0000gI-Mz for xen-devel@lists.xenproject.org; Mon, 02 Sep 2019 16:41:55 +0000 X-Inumbo-ID: 91141438-cda0-11e9-aea4-12813bfff9fa Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 91141438-cda0-11e9-aea4-12813bfff9fa; Mon, 02 Sep 2019 16:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567442515; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1DCZ0BGjoPYTWaE4L9sHBAupmaX9w85d3OynHWl3eIo=; b=iBqrsOSpJODnRlU1MOzIZbjaGtvOank44GZuj3UIKMkZsg846Q/6NHPw 9ZCiibMSDkzBkgC55UIEGrCGnXeY6NOcUXAjLwu7c4+CDKHIZODwgJv0n T/eugVxA5CizfRaLJjvaXRnwWOZC9eYng//iOFOVpN4cHFNOJnNR/QOZy c=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: BQ4qazOK3oQCfwtwvK5feWZnV6q+Buv08PxUqejUmZa99NwEoEdStsFD9UTlUKQp2zZDU1CgL5 3hjifLFlA4IFgxeYNT3JeHP9YXrNuMS822cLGD8iO8da+fgiDMOvk14D4EZojebsUHuTflBU11 o+S/39X0h45whw5gTy0kJZ7rC3yc5fn7A0Ao4VcC/68kuKMP+Gm5NXX0slRxZ9AWbhUP2Udc0S NyZqyTrM3G0CXjenk42nh0fKpFlkRti6UepsG5lwHcZ7nwhC4DfnlvUkrzmcyiov10KYAh3Zpb 2b0= X-SBRS: 2.7 X-MesageID: 5033358 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,459,1559534400"; d="scan'208";a="5033358" From: Andrew Cooper To: Xen-devel Date: Mon, 2 Sep 2019 17:41:47 +0100 Message-ID: <20190902164148.28977-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190902164148.28977-1-andrew.cooper3@citrix.com> References: <20190902164148.28977-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] tools/shim: Fix race condition creating linkfarm.stamp X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , George Dunlap , Andrew Cooper , Sander Eikelenboom , Jan Beulich , Ian Jackson , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" In the case the while loop gets interrupted, the target musn't appear as up-to-date. The mov $X.tmp $X must be the last action of the rule. Signed-off-by: Andrew Cooper Acked-by: Ian Jackson --- CC: Ian Jackson CC: Wei Liu CC: Jan Beulich CC: Roger Pau Monné CC: George Dunlap CC: Sander Eikelenboom --- tools/firmware/xen-dir/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile index 697bbbd57b..df3f5a7006 100644 --- a/tools/firmware/xen-dir/Makefile +++ b/tools/firmware/xen-dir/Makefile @@ -32,9 +32,9 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE echo $(f) >> linkfarm.stamp.tmp ;) cmp -s linkfarm.stamp.tmp linkfarm.stamp && \ rm linkfarm.stamp.tmp || { \ + cat linkfarm.stamp.tmp | while read f; \ + do rm -f "$(D)/$$f"; ln -s "$(XEN_ROOT)/$$f" "$(D)/$$f"; done; \ mv linkfarm.stamp.tmp linkfarm.stamp; \ - cat linkfarm.stamp | while read f; \ - do rm -f "$(D)/$$f"; ln -s "$(XEN_ROOT)/$$f" "$(D)/$$f"; done \ } # Copy enough of the tree to build the shim hypervisor