Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2261043imu; Tue, 6 Nov 2018 11:34:10 -0800 (PST) X-Google-Smtp-Source: AJdET5fFg/bSv1OyQwxTPlz3urZWKNx1uyu7KZui8ZREOwR3GsLIwc0dWT8jCvPGGaeUCobXCnja X-Received: by 2002:a62:198c:: with SMTP id 134-v6mr20433977pfz.33.1541532850725; Tue, 06 Nov 2018 11:34:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541532850; cv=none; d=google.com; s=arc-20160816; b=Q2rrBkUI0qjT4eV8F2GC23m5xHgyXHIUN9BIhC9rhJNmm/gbiEpFo0uBXgS4DtTqpS w4lAYPJp3lJdk04Br01rI5svEjz3N+I9YCGZInm9A60EVCAFTlSOgOrPvwXf0WtfCLqB HHRYAuRB+9InnBVhE/qttadRzPzyhHohK7U7pTpGbc2p1WIwhBOUB6XEcpsuHBOWB7tR +A9AZNQ6mj2brIileiGeX//UYiIoK8Geyu39H2BEj1QbE2Vti2S/aZf/h97gRBR1wdGf 52g36gnuHG9Gw6UcEbi1l5roYgsF989R8BwkJzi82OiaS66zhOHjQoIXwGrUxVBQJPji mtRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:cc:to:subject:from :content-transfer-encoding:mime-version:message-id:date :dkim-signature; bh=klttJ/tCpFCRzR1Lui2NJgaAK/DsmXVQLDhG9SFTTVk=; b=Uu+W9G1SA2ErriwAU22n0k7vMYp0Msu7Qc6YKutBSMjl+0xp1I/Kjt94gNoFr7f8ID 83Xc5ZXJJJIJ3ebyvFlQ7hRlNAmQfyR9yYV8BAxU9k/e2whGfALzjl9zrnZ2A/u4+LIF RdoOUoF8ArOn+jcDkzlRsBFkzGQIqYX2s2kJ3AG7o27MAeBlQ+PntjlCp1zMAu6QWufj r3syy9wtDyNX8pEvEMuaTlJtcY0xzi1VWOHIlLrSFMsnUUw/XbUTz59iGb2qFHJ9Jb+m 9uGuivTcK3NfE9pVpGdlHN+v+GJdo4hysmlEFbCEy/y5Isz6zkDwfmjHUbcby6JurLaw zAAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@genki.is header.s=dkim header.b=ObKyxVxk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=genki.is Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13-v6si35369565pfc.156.2018.11.06.11.33.55; Tue, 06 Nov 2018 11:34:10 -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=pass header.i=@genki.is header.s=dkim header.b=ObKyxVxk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=genki.is Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388314AbeKGE4c (ORCPT + 99 others); Tue, 6 Nov 2018 23:56:32 -0500 Received: from genki.is ([104.200.25.21]:43210 "EHLO genki.is" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387624AbeKGE4b (ORCPT ); Tue, 6 Nov 2018 23:56:31 -0500 X-Greylist: delayed 401 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Nov 2018 23:56:31 EST Received: by genki.is (OpenSMTPD) with ESMTP id 62d872ac; Tue, 6 Nov 2018 19:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=genki.is; h=date :message-id:mime-version:content-transfer-encoding:content-type :from:subject:to:cc:in-reply-to:references; s=dkim; bh=kI74M9ymW 7EHRl29+Eu/hRBf14w=; b=ObKyxVxkVVAmtfyfwlu0J4dyiwdhHe9bWoGMsM0tC ryFOEauR7aYVKRVNcZmpA78N6OOqO0C/AI/LvEiQUSatQaoq0A+dGXM5J/Hc9Og/ 9Iw0CX4wQBdZmUGFHeYZOJuS8ga7T8AGvtWBT/Ik1PIPJ9q9rP2jw8/d90nIG/GK P7I7MHj+O8cMgWLMVyih0AUBvprMXHzEZFcd9U9Qz+AAK2deF3UnyjzPn33iWzS7 X30NgU6CcDQze2g5frN58y+ijG7Fe7SIp/Xr/ovZObpV07EK+m4Q8bBRWlajsnKf jmRp2nqVmRzmUfcRoINKdCmza5QRhxMwAyZMgp2zTHPwQ== Received: by genki.is (OpenSMTPD) with ESMTPSA id 76876191 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Tue, 6 Nov 2018 19:23:06 +0000 (UTC) Date: Tue, 06 Nov 2018 11:23:05 -0800 Message-ID: <20181106.192305.406697677@genki.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 From: Genki Sky Subject: Re: [PATCH] Revert "scripts/setlocalversion: git: Make -dirty check more robust" To: Guenter Roeck , Masahiro Yamada , Christian Kujau Cc: linux-kernel@vger.kernel.org In-Reply-To: <1541527838-4585-1-git-send-email-linux@roeck-us.net> References: <1541527838-4585-1-git-send-email-linux@roeck-us.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, On Tue, 6 Nov 2018 10:10:38 -0800, Guenter Roeck wrote: > 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. Hmm, so in summary: According to 6147b1cf1965 ("scripts/setlocalversion: git: Make -dirty check more robust", 2018-08-28), one scenario requires the index to be refreshed to get a correct "dirty" or "not dirty" status. But according to your commit here, another scenario requires the kernel build system to not even attempt to update the git index, and doesn't care / aren't impacted by the cases where the index needs to be refreshed. Perhaps both scenarios could be satisfied by having scripts/setlocalversion first check if .git has write permissions, and acting accordingly. Looking into history, this actually used to be done, but cdf2bc632ebc ("scripts/setlocalversion on write-protected source tree", 2013-06-14) removed the updating of the index. However, I admit I don't understand the justification in that commit from 2013. I'm no NFS expert, but perhaps the real problem there is an incorrectly configured NFS setup (uid/gid mismatch between NFS client/server, or permissions mismatch between mount options and NFS server?). Christian Kujau: can you speak to that? Well, we could also make our check $(touch .git/some-file-here 2>/dev/null && ...) instead of $(test -w .git) to handle misconfigured NFS setups. But not sure if that has its own problems. Thoughts? It'd be nice to find a fix that works for everyone. Genki