Article View: linux.kernel.git
Article #4256Shallow clones: ctime shouldn't be used on FreeBSD with UFS + soft-updates
From: Jessica Clarke
Date: Wed, 02 Dec 2026 18:10
Date: Wed, 02 Dec 2026 18:10
63 lines
12774 bytes
12774 bytes
Hi, Git uses ctime in various ways, but one of them is to check that the shallow file has not changed since the last time it was read during a shallow clone. In the case of the shallow file, it comes into being by being renamed from shallow.lock, and is then immediately stat’ed to give the before value. However, FreeBSD’s UFS soft-updates implementation has slightly surprising semantics for unlink (and internally uses link + unlink to implement rename): it will update ctime at the point of unlink (and thus rename), but will *also* later update it once its asynchronous soft-updates work is finished (see [1] that explains this latter update, and introduces the former). This means that, if Git is keying off ctime to determine whether shallow has changed, it can race with this soft-updates code and potentially sample either side of it, seeing the value change solely due to internal bookkeeping work in the filesystem. As a result, I see git submodule update --depth=1 some/path sporadically fail on a FreeBSD 15.0-RELEASE-p11 (but as far as I know not limited to this version) builder we have, with: > fatal: shallow file has changed since we read it I have set core.trustctime to false in the build user’s ~/.gitconfig as a workaround. However, I imagine that other uses for ctime might be tolerant of this behaviour, just leading to minor inefficiency, and so having this default to false on FreeBSD might be a bit too broad a fix? I don’t take a strong view on what the right fix is, but would appreciate it if Git could by default on FreeBSD not use ctime to determine whether the shallow file has changed. I doubt it matters, but this is with Git 2.56.0, for what it’s worth. Also, here’s an illustration this behaviour (whole script is set -x): > $ ./ctime-after-mv > + rm -fv foo bar > bar > + touch foo > + stat -f %Fc foo > 1796226770.687840000 > + sleep 2 > + stat -f %Fc foo > 1796226770.687840000 > + sleep 2 > + mv foo bar > + stat -f %Fc bar > 1796226774.694149000 > + sleep 2 > + stat -f %Fc bar > 1796226775.523101000 Thanks, Jessica [1] https://cgit.freebsd.org/src/commit/?id=1a75045196a26c2dd00a03a3d6d231dd5b422a9b
Technical Details
Message-ID:
<41F956FA-64BC-4F68-8619-2E8B9889C26F@jrtc27.com>Path:
mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76893-linux-kernel-git=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76893-linux-kernel-git=dewy.ru
From: jrtc27@jrtc27.com (Jessica Clarke)
Newsgroups: linux.kernel.git
Subject: Shallow clones: ctime shouldn't be used on FreeBSD with UFS +
soft-updates
Date: Wed, 2 Dec 2026 18:10:33 +0000
Organization: Usenet Network
Message-ID: <41F956FA-64BC-4F68-8619-2E8B9889C26F@jrtc27.com>
MIME-Version: 1.0 (Mac OS X Mail 16.0 \(3901.200.71.1.16\))
Content-Type: text/plain;
charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2028127"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:SOMEHif070WNxh3ZjqBeJ8kvYBc= sha256:cG8DOsFWOSPfmdDrbofUueLfXyjbCviVTWh/ksaG8Ak=
sha1:Lj0WHNujIptvOHUZQzhdWXvMgFA= sha256:zFd9OWOJbqylDEM+pnkx48IDvdKAHISaDOMKDBfrgYQ=
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 E13371176ED; Wed, 2 Dec 2026 21:11:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=jrtc27.com
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 0tkVGs9-s8Fk;
Wed, 2 Dec 2026 21:10:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76893-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=jrtc27.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 3CF1C1176CA; Wed, 2 Dec 2026 21:10:49 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id C7B122AE12; Wed, 2 Dec 2026 18:10:47 +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=1796235047;
b=RKeEpePgzocb5OMNHPaYgBqogs5r9YxV2n7QP1iBECWkk5gb8wVDXC051AamYuRxet8P
KDmtYQNakOlXyw7kUOgFIW1xIo7vKqju8O81UvwdU/fziR3cRJOYM52YLNqqfH34OME2K
D3YaSLwSfZU+4ghL/w6arLPExL/rEcT8KGZqzNThAWgbWMaOjYi1TNYdVZcZB5KUz0Azu
91XqQJJj5uOAUbYcnGsHp/5oi01dKyim1eoacv8QTgufXXWWLKC5b75+oOb/Kkj5ScXb4
MzGfi5i8JKKFyAHi20xGIRGN4/4hdjNnzsPClQfV55+tfH+C97R06ZrS+YjCL8xruZQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796235047;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:Content-Type:Content-Transfer-Encoding:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:Mime-Version:Subject:Message-Id:Date:To:
X-Mailer;
bh=ti2AXMTTj3J+U99GN5w1wmg/6vtVC6Bhwli0M1MEIhg=;
b=MOH54U9X9Zr/YcOWVBHWSSO8qAzglQoJ9cpQ9ZKM96s1FctBSutKpUXmg0+rQ47J7IoL
6s4zv/h6CoUYlLj8VZaeZJ76/6OK8OopTnBQ9cFXptQjSIScZsTYE3M31Q/x34cNoEgLv
SusXJdDnQK12DX1Yn88tiYkMxiXce+AzROvUc1z5APyRKP+LNq67p3tHdVumMG+kYPKl9
fhO6ZkFFwUOMKwv7SpsvW79c8PufsVqCij11zFJ4n+VXlGalhEgkN7HjDHa3p53Bn6K/B
7tCrydYYrFuRiMaoxLb81yzl0TjgwLLa9JNT/0nvPrF1QUm13qivfuNd2TDqc+FgI1Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=jrtc27.com header.i=@jrtc27.com header.a=rsa-sha256 header.s=gmail.jrtc27.user header.b=Ut7HLBBa;
dmarc=pass header.from=jrtc27.com;
spf=pass smtp.mailfrom=jrtc27.com;
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 9BA7A606A333;
Wed, 2 Dec 2026 18:10:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=jrtc27.com header.i=@jrtc27.com header.a=rsa-sha256 header.s=gmail.jrtc27.user header.b=Ut7HLBBa
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796235046;
b=RfeZWsp2eQhzjc9palxB2yu/PzQxxj33iE0e3jphIg9+nZRliHFu3FRbqWPI2YZhYaks
97R7c+Ub5Gnx472WDmNaru2GdXPSumqr5fAWBKurcSGNE5A3PDekKs5OKA2j5MLw39ZM7
C6W4pUgzaAlJhDwwStDyuRSxVGswEBbeOMZzg0apIrn5KiiI4QZ9UQ98xD0dXLHo+9QIU
IEVG5m6AhXMpdrrLhIwtA8r9ujgU9ZdgmOU1JoUef1ADmdGLu7RHTwx8FlyT93oJRtm0L
APr6GzVDpddQiO6FlOEpcD/3tP2LGfF544NK+Peqpzh766Qt2qoSyyltM5F4OJOpr7w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796235046;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:Content-Type:
Content-Transfer-Encoding:Mime-Version:Subject:Message-Id:Date:To:
X-Mailer;
bh=ti2AXMTTj3J+U99GN5w1wmg/6vtVC6Bhwli0M1MEIhg=;
b=O/2ylivtKBfpAHl/jA/tSgSJz4VeZAhzpMiji9/U0/dNFIPN7KJOpfD8b+N2BgZXaAFj
NxSjRLdpX4DCM2I1z80gv1A8qfHkYc24ZZKKkuvv15Qo6NaimxgK+RwoP6RhGc+hhGs4H
Y5Lw/eed9K2BoeTGrY7Na/29AY8mcTLfat9AVIbq+lrS2oY6x+NeKsy2Fb/+/iMHdfZNF
VAoh/tZHOArRX+8zfALYxwiEZ9ri6Oa/s3VFRN7SN8yrD9WE1Uv8I4SHmY8fOXVOd0YCn
Y5R440e98blpBFqlsV+fGhR5IE7dr12ruUly4jKGvHWzg6lO/Efpfnd8Lwsgrd+/E5A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=jrtc27.com;
spf=pass smtp.mailfrom=jrtc27.com;
dkim=pass header.d=jrtc27.com header.i=@jrtc27.com header.a=rsa-sha256 header.s=gmail.jrtc27.user header.b=Ut7HLBBa;
arc=none smtp.remote-ip=209.85.221.52
X-Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64FC4606A322
for <git@vger.kernel.org>; Wed, 2 Dec 2026 18:10:46 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 64FC4606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=jrtc27.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=jrtc27.com
X-Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-490d59c3edaso73469f8f.1
for <git@vger.kernel.org>; Wed, 02 Dec 2026 10:10:46 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=jrtc27.com; s=gmail.jrtc27.user; t=1796235045; x=1796839845; darn=vger.kernel.org;
h=to:date:message-id:subject:mime-version:content-transfer-encoding
:content-type:from:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=ti2AXMTTj3J+U99GN5w1wmg/6vtVC6Bhwli0M1MEIhg=;
b=Ut7HLBBaPPAzp9TcV3ZTHMVtlwITfKqZEHDh3ulKbIYkK+sP85fH0OeftMT6RZGbXB
361I4xzLkQYSJ3/zchRjz2mx0J4qXbXT+CqNxpCf7Bd8Ov6HtT1PKg/SazZw+jqg0+YO
+9ZXzrfErr5ksYBn4rtZNrJXa6wT1jzOTL1xDpH1R7uHEUTbl5ZgLqLpyZRa9Re+z8/D
xJSr7JyPlWUrBiLh1A+Tl8UGWJK44N8Q1AAmwemUm4mDvuOGaK/QqYeO+qCWylQocnQG
C6oP/g/aPpTfmbtcFjrbrBCQlpDjxcIs6Zoe1X3Jyq9tcWOJoR2tnEKuHkMYXHB9/koS
GPDw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796235045; x=1796839845;
h=to:date:message-id:subject:mime-version:content-transfer-encoding
:content-type:from:x-gm-gg:x-gm-message-state:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=ti2AXMTTj3J+U99GN5w1wmg/6vtVC6Bhwli0M1MEIhg=;
b=wJCni31qMKNdMzESfxJKd0blCJe05HYVZfqqIXv/+6WCcSpHZPMw3zO2Cn9EAc1Pim
HM7p6WwfiS0BqIa9NFDWLeOGrxx0/14JzC2iGICeTvn5ziRvzOjH+ERnxUMAvehgrQjD
AseUUOqOpOXsEx+UtOzHRhmgB6T4Ool2D/drBr5cMqIVP56290NvE7xEWUSj3dJ8ZFmf
VkLZt39Di12fOlOKCcJuc1bQJ6DorhZU4VFaG4JI8vx/EdhOnnAjA7AMTpIDrV3BgyB7
I8ZXOfsCtTVY0XdBMx8pGy4JB/Cbw7+5+wJLBkSgAkCN83fLlAvlIX9DKSZYJi90oyi7
IKPw==
X-Gm-Message-State: APuU4Z/FMzfEwBZ+WhBZnLXLTPsDg2dRBykmnYoeWgPI5oGS5fpH87Ds
mop+xePcbpJe73zQjJ/baHJ0z3jNfOPccpIcmQJQ3uElH7g8gCXUnqSaQhZ+ZA75WPW3TsqgNbY
R+Dd/
X-Gm-Gg: AZFdTZchVVlTIj+mYw6L7F6nGqnpX9+LIHJ9dPSRQiwNeRphdOhINpf5UXC7HMIjJzP
yuZwD6a6ROB7W7uccw9pXcOJdqx83cysxmvwjSSRd3Nq3M4MN9jBOGmiLquZIUSgPz74Hwf9LKF
yMgxQDwQN4UKFDTBXrdJMpGirgd/CDoGA7amyKAECgMIxkzdkuVx8vm2eHaVi+KS+hOcFaAqQm0
GnNXB4/JbGsJAj7XFkd3xEzHNXxG1YYnCHluV7CvEvhJwO8D1RELku40is6oAivUl9fzbqUYDDc
VhFvY9CmHLnB6HtL+yr0Nf1EpRJrKnrpZq25LFvfQa1hNPDPpfyIVi0wtUKxB22S5IOpSaeb/tq
KKKVX+xkphdn0hl6m63AGfEu2j8JYU4XG6N8YcamSH9N8bDJfekdZsiQ5IHlIKEWku5REdPQb6K
qfXLbZZXTTWaOXeiMMnNXDjBwZM1AAtmdrBXUz6I57pgFnhOOb6sL44fR/Mc5gA/lcrL+HO7XQb
5ybcJHoFawCYmvD1u3SZPPScnk0sC0858z2ZAu+2FvwfYmzscRCcMaSlOGoUXGrjiHFceT7pGVf
lPmr3nctF9sAGCrZwflO/JTpZxVCfR3vn1FoZPZ1QWW2ZP6SCe/z9g==
X-Received: by 2002:a05:6000:40ce:b0:488:8347:a110 with SMTP id ffacd0b85a97d-4abafd02fa0mr85985115f8f.7.1796235044520;
Wed, 02 Dec 2026 10:10:44 -0800 (PST)
X-Received: from smtpclient.apple ([2a00:23c8:f542:6401:a92e:b92a:179:48d])
by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4cea296f852sm877763f8f.59.2026.12.02.10.10.43
for <git@vger.kernel.org>
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Wed, 02 Dec 2026 10:10:43 -0800 (PST)
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-Mailer: Apple Mail (2.3901.200.71.1.16)