Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2208310imu; Tue, 6 Nov 2018 10:40:35 -0800 (PST) X-Google-Smtp-Source: AJdET5fYa+PR32gh+kI75iiN3VRCwnv4J01uYvvdVSxvfT1M8KxD45erSGABbT2CzO4ge9/nFk/a X-Received: by 2002:a63:3858:: with SMTP id h24mr7374384pgn.300.1541529635452; Tue, 06 Nov 2018 10:40:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541529635; cv=none; d=google.com; s=arc-20160816; b=mzPxvYh8+FEfap0LEqA79fUyL9To0xx17ynY1rli5EQYnScGJEpZ2L/ei5sJpzRXL/ j/1YxdoOf7x1maS3gcMOfHzIXme6E2iSDQ5OB1cDGoL1aLqjkUyf20Abt0yflc6ovlmv 0Bz5xXBZ6FD4cPTc2FkshZVVmOeySay9jw8oHsEXJN6m8CQly9CMY+/VydB13Gki1L59 cMsmpy4hyA6A9vsvEudgQQx+ZycWodGomDNVDX4dWCGfAyodRZuV9kOpO622cY31awhv GDoOHXlf7MFaJCMhZYbKiJUVeZsfwLJ1UOrwDAgUifrXDNuUiCJu8c/14ynQA6ZS7Xdi 3vCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=fz3kunU5ZVhqs/5pZsL/70JG8neMn8vZHcTgAU3UaoA=; b=TljZGrqEJn/ttQ/HbJjuYtFExH65pb9WJkXKFYXYOIo+gkQNDy/L78p5Tl33/OXsCz XabxQZ90JhPvl8Oys1pOqlUqZ99V2jsOOr0cWVR/gk7k8BMVOVqrPVGm25JFfbQc6gdh F+Ou+ZcYXCBlRZ6zYPYKuYHqQp505BiXBcMXvTyxVdYnzpe7qa8o0XHjKVnTk0n024vh K8+zwEhVc7g9Z6bnAQ+PHitv7BmQ2VnbrN71nzJEH20XYyUUVAYYH6tu8SRKSxPwZYbb iWyZQxlqiY6S37fd2c8P58Ptn62zRFy6jDJavf/VNGzbDOJRy07YxACIioMcDMAkk1ca vl/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LCbXLv0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11-v6si29400801pgp.592.2018.11.06.10.40.20; Tue, 06 Nov 2018 10:40:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=LCbXLv0e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730913AbeKGDhO (ORCPT + 99 others); Tue, 6 Nov 2018 22:37:14 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37568 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730717AbeKGDhO (ORCPT ); Tue, 6 Nov 2018 22:37:14 -0500 Received: by mail-pl1-f194.google.com with SMTP id p6-v6so6572094pll.4 for ; Tue, 06 Nov 2018 10:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=fz3kunU5ZVhqs/5pZsL/70JG8neMn8vZHcTgAU3UaoA=; b=LCbXLv0e98wW/rQK/pK+mYoWLLpFF0sYEmhQW+qcxJKnzYnerNV7uOIhErlCbFJvqC NvGKd4dO55scZX5uD+h2Kmrh36oetYz7IDKG4oi48KCQOKZnPbmn1+fckQ3DcrWOuG40 Q/Fb+IpfUQ8mojuOy4oN/Y7ZrG0vWp9ZTTDMCe4AkqpngFHfCh5FI/h2vlFpjihhtZ1U MEui33IBdw5L2b8bVrTFqi0Kpim60WBnSYAhFXrBsRMmZ2W2SWamXRP3aEyFe8NPMyrp QxvF75LNl9wwfCYIR3j9Xid0AGXCwjKalRxXtZxEeyLKrpEWB7hiqi91R0v+/0Nh3Gk1 AQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=fz3kunU5ZVhqs/5pZsL/70JG8neMn8vZHcTgAU3UaoA=; b=omMaPhXkcxFUm5k3XGywreixNEzgsUO8XGxQj0Q7yoGxqZyNOV3/vSLmuOlpabCGus RTbFUHgupc4g3Y/6fPdC5VXdbHD4NqL7njT0ejXcSRbbQ7K7ayu3CMwlJVmgY2sH2xsa +SkUtThADkx7GYJWNi62oxcio1gDZ0mNuPLr5B/wS814N+BsM9y12fI/HXXHVYBAlpn+ ZNsh66fk/eWvUyD497MO2v2UnxcOcGY3xDgabYrX8c3kyyGXEiAQrg/pLcVSh7dyrIlZ m15ICNOvPglzLF0m9R+8e7T5C/yGCOTlY4wi9GOehhHx5GSNH1dlXdaXB9rFLh+rdVrf RFIg== X-Gm-Message-State: AGRZ1gL0WZ5P22ZH1Rtf8ql7xDUEuOGYF9UOTMJf559ITW5Y/iX9zGt/ QRdFBAPORmRjJAqgc6UtV7n2y/Qp X-Received: by 2002:a17:902:b592:: with SMTP id a18-v6mr26607611pls.248.1541527847969; Tue, 06 Nov 2018 10:10:47 -0800 (PST) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id g27-v6sm21363552pfj.162.2018.11.06.10.10.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Nov 2018 10:10:46 -0800 (PST) From: Guenter Roeck To: Genki Sky , Masahiro Yamada Cc: linux-kernel@vger.kernel.org, Guenter Roeck Subject: [PATCH] Revert "scripts/setlocalversion: git: Make -dirty check more robust" Date: Tue, 6 Nov 2018 10:10:38 -0800 Message-Id: <1541527838-4585-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349. The reverted patch results in attempted write access to the source repository, even if that repository is mounted read-only. Output from "strace git status -uno --porcelain": getcwd("/tmp/linux-test", 129) = 16 open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = -1 EROFS (Read-only file system) While git appears to be able to handle this situation, a monitored build environment (such as the one used for Chrome OS kernel builds) may detect it and bail out with an access violation error. On top of that, the attempted write access suggests that git _will_ write to the file even if a build output directory is specified. Users may have the reasonable expectation that the source repository remains untouched in that situation. Fixes: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust" Cc: Genki Sky Cc: Masahiro Yamada Signed-off-by: Guenter Roeck --- scripts/setlocalversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 79f7dd57d571..71f39410691b 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion @@ -74,7 +74,7 @@ scm_version() fi # Check for uncommitted changes - if git status -uno --porcelain | grep -qv '^.. scripts/package'; then + if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then printf '%s' -dirty fi -- 2.7.4