🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #2904

Re: APFS, mmap, and git diff reporting no changes when there are changes?

#2904
From: Johannes Sixt
Date: Wed, 11 Nov 2026 07:20
30 lines
8332 bytes
Am 09.11.26 um 23:38 schrieb brian m. carlson:
> On 2026-11-09 at 22:05:55, Harold Hunt wrote:
>> One could also argue that this is Apple's bug or deficiency.  But that
>> could take months / years to resolve?
> 
> This behaviour is allowed by POSIX:
> 
>     The last data modification and last file status change timestamps of
>     a file that is mapped with MAP_SHARED and PROT_WRITE shall be marked
>     for update at some point in the interval between a write reference
>     to the mapped region and the next call to msync() with MS_ASYNC or
>     MS_SYNC for that portion of the file by any process.
> 
> However, Git relies on the operating system to reflect an accurate
> modification time.  If you write files to disk with mmap, then you're
> responsible for calling msync() in a timely manner.  However, as I said,
> that's extremely improvident for things like files in the working tree,
> which is why text editors don't use mmap.

Not to mention that our mmap emulation for Windows cannot reproduce the
Linux behavior (timely update of timestamps) and is more like the macOS
behavior (delayed update of timestamps). We cannot have an accurate
(atomic) msync emulation, either, because not even FlushViewOfFile[1]
updates the timestamp.

[1]
https://learn.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-flushviewoffile

-- Hannes
Technical Details
Message-ID: <8b881ed0-f30f-41af-9e59-f4e93006545a@kdbg.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!git+bounces-75146-linux-kernel-git=dewy.ru
References: <CA+-E0BVhYRsktwaUDxtobAXV98dymKg2n4ghod292imymE5C_A@mail.gmail.com> <avJLR6EdZ4OYmTpj@fruit.crustytoothpaste.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!git+bounces-75146-linux-kernel-git=dewy.ru
From: j6t@kdbg.org (Johannes Sixt)
Newsgroups: linux.kernel.git
Subject: Re: APFS, mmap, and git diff reporting no changes when there are
 changes?
Date: Wed, 11 Nov 2026 08:20:29 +0100
Organization: Usenet Network
Message-ID: <8b881ed0-f30f-41af-9e59-f4e93006545a@kdbg.org>
References: <CA+-E0BVhYRsktwaUDxtobAXV98dymKg2n4ghod292imymE5C_A@mail.gmail.com>
 <avJLR6EdZ4OYmTpj@fruit.crustytoothpaste.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="799753"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:vqk8vi1QycWA7JwYoXakqpBkL4A= sha256:Q71F++PuzNkBW7M7rR3kC/or8F15XqED+2TadJ1Cz2k=
	sha1:pYX/0W+hwZ9XpFlctUAgP8P6hwM= sha256:dVs3GzFXsUZFzYpsb10ncb41Cy6ZwBKvotJS92Hsm2s=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 02F01113E4B; Wed, 11 Nov 2026 10:22:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.951
X-Spam-Status: No, score=-2.951 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id bUcc0gxcBJrS;
	Wed, 11 Nov 2026 10:22:16 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-75146-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=kdbg.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id EDA65113E2D; Wed, 11 Nov 2026 10:22:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 3D186356AD; Wed, 11 Nov 2026 07:20:44 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794381643;
	b=g0u2mdadBMm6avRjColKTGOw9Y1AwrgdqiUm7SXUmT/zhYoEedpaWRE25oaIi8qqkmtn
	 TOJ4aniU4Z264Pb1Anz95vDaVnsdMaUlLdDsWO1k05Yq/zv6RvN5P7gz7cIMxYJ8i1166
	 8ORV4xMJP+1s8Zq68SArIF+Do9sm9joGSelvdkJGKtTCVlCDJB2DNfUUClKMr8UfO5m8R
	 YtCUsFySaxOiCHtnzG8WmjILzfdA9LLdFG10fRbrWWNYJj9T9EoQOFSyudlSm/srCvMKo
	 EwiuCoS1QVJOZRRKHg/R6Gk9rtfY94Nc8WGx8bliekr4tEDzkP/VHpI1xfFYjLB0ULw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794381643;
	h=X-Original-To:Received:DMARC-Filter:Received:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:References:Content-Language:From:Cc:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=QrbRuRak5jM7hMpw1/BfuZIMUIR6uZoxhSrJyTcAJZI=;
	b=gvaP0WaLaUJ4o3OjigYF6CiRa4tYH3267zNQ0DRr6WxNSd6iEml9x/bNVpR45EJYiwO1
	 k+sFNM9l3LvHo9mxsAOoUlrJ+tP+sm+YqJnj8qw9QvYze0r4hln7AYxCSvHKQE0prBGmt
	 DyP7LXAAYwoIuOGiRoMGKkHYh4ytklzOtWXDD6Hfo7ZpfHIrA/jfykrTcUUMqfEcZdrhT
	 soxBxgXwGQvFiomRW5uV+YZ2EMDcMqbR4BEWJa0JWBYQqpB+er1sOu/yAQD12GSelC4vK
	 6QIGhSjqJb3Tx6q/17cKkwpkP6HKPAIJD4NCxcb8A9LPbjMYqe64z1eElS+KnvOv+eA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=kdbg.org;
	spf=pass smtp.mailfrom=kdbg.org;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 80B03606A32A;
	Wed, 11 Nov 2026 07:20:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.33.87.15
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794381642;
	b=zsKQ014i2wZt53KTPOWbs1wH4OvYicEwhB7EJJJJ2jZmGaXHk8DgB+h1vMUaf4h1ee2Z
	 oU8B+xgzitDjcZ0LcXFDXG0wDdd3qkufBxParmzTw1eJzInDnPbUhs0Fud+0UhMtHCsRH
	 CQqkDoSZiIwW57x3pjMupL5pNfpuvcdzGnUiG8bfOkblm0zzCrobq3AGv6ORTJLiWmQmQ
	 BOo+TWBupB6yztkquMRnc9T/kQ61wNSBQl+Fm3ZaG0A7KvMf1nvUdOdMAUfFfVrqfaRZ4
	 om/6MZzIzzwue+A3cYGeY9K4sSqpSn01MDNUMiHPlAMFCzP9XyuK54hwWY3FkXOFiMA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794381642;
	h=DMARC-Filter:Received:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:References:Content-Language:From:Cc:In-Reply-To:
	 Content-Type:Content-Transfer-Encoding;
	bh=QrbRuRak5jM7hMpw1/BfuZIMUIR6uZoxhSrJyTcAJZI=;
	b=r+Du1/gpv0ALHpBUkF/TldWRRxwXn6nLxF43IO8ABsXQDlUg4dWhOzR1S+M9pze3ABZk
	 5FMnt/rFYk4i36A7X7po71NS7gxGa5uwoHbc0KiEO4luq/ZWV/WXJ7EdjpCkgm6z5u3KF
	 7Y6O5+iiT0eDYCF0ZcFIAE58ZnicE+F5eSYFnDABBzGQd2tDD+eIywF8yuUaoQi1YS7fg
	 l8592ly/tNfzWpe8KIOPNFZR4DjzlSASQ/R2fqEvexiFx896FqCClP5orjUcPACaK8Ir0
	 HZQhGB1QTYePjymx3pQSulnr82OBGI5PI+fxKDRTUbT8xHoep790Znpye4Om8/HSr5w==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=kdbg.org;
	spf=pass smtp.mailfrom=kdbg.org;
	arc=none smtp.remote-ip=213.33.87.15
X-Received: from bsmtp1.bon.at (bsmtp1.bon.at [213.33.87.15])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id E68C5606A320
	for <git@vger.kernel.org>; Wed, 11 Nov 2026 07:20:41 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E68C5606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kdbg.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kdbg.org
X-Received: from [192.168.0.102] (unknown [93.83.142.38])
	by bsmtp1.bon.at (Postfix) with ESMTPSA id 4jPZg23hXzzRpL8;
	Wed, 11 Nov 2026 08:20:30 +0100 (CET)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: git@vger.kernel.org
X-In-Reply-To: <avJLR6EdZ4OYmTpj@fruit.crustytoothpaste.net>