Article View: linux.kernel.git
Article #639[PATCH 0/3] object-file: fix ".keep" lockfile ownership in ODB transactions
From: Justin Tobler
Date: Fri, 16 Oct 2026 02:28
Date: Fri, 16 Oct 2026 02:28
45 lines
9391 bytes
9391 bytes
Greetings, This series addresses a bug report[1] regarding a git-receive-pack(1) process deleting ".keep" lockfiles of with the same name but from another concurrent git-receive-pack(1) process receiving an identical packfile. Deleting the ".keep" lockfile for another process leaves its newly written packfile vulnerable to deletion by another concurrent housekeeping process. The root of the problem here is that the temporary ".keep" lockfiles are generated and registered in the object quarantine prior to being written in the primary ODB. This means that even if the ODB transaction never commits and exits early, the tempfile atexit(3) handler still runs and tries to delete the lockfile at its expected final location. This blindly deletes any file matching regardless of whether is was created by the process. The first two patches are some preparatory changes so that `odb_transaction_files_write_pack()` is able to start explicitly creating the lockfiles without relying on git-index-pack(1). Patch three migrates lockfile generation to happen during ODB transaction commit to ensure the lockfile is actually able to be written before registering it as a tempfile. Thanks, -Justin [1]: <932e8e425aecfbd33c1e5caf66c80a0226abacba.1789385483.git.gitgitgadget@gmail.com> Justin Tobler (3): pack-write: lift and expose index-pack report parsing object-file: explicitly write ".keep" lockfile object-file: write ".keep" lockfiles during transaction commit object-file.c | 117 +++++++++++++++++++++++++++++-------- pack-write.c | 69 ++++++++++++++++------ pack.h | 10 ++++ t/t5547-push-quarantine.sh | 29 ++++++++- 4 files changed, 181 insertions(+), 44 deletions(-) base-commit: f57c9a73884400380bddd172acc88b569834f909 -- 2.55.0.424.g13c7afec21
Technical Details
Message-ID:
<20261016022901.3838402-1-jltobler@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72189-linux-kernel-git=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72189-linux-kernel-git=dewy.ru
From: jltobler@gmail.com (Justin Tobler)
Newsgroups: linux.kernel.git
Subject: [PATCH 0/3] object-file: fix ".keep" lockfile ownership in ODB transactions
Date: Thu, 15 Oct 2026 21:28:58 -0500
Organization: Usenet Network
Message-ID: <20261016022901.3838402-1-jltobler@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2669516"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:i8yqtrMiQVotreOiOzvCSx1MBic= sha256:O8gj4cRMjCbh1zdYOiBfdB4K6ueN5pQzzNaNaT/0vgs=
sha1:OuZ54XxRyks+pcXtev+detPLZ/0= sha256:EQCD2Vfv+TRes0mPTignlABkCFx99lPJU7uqwC9R27I=
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 06D3511043F; Fri, 16 Oct 2026 05:31:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
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-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 VCX1hBdswR_I;
Fri, 16 Oct 2026 05:31:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72189-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id C640B1103EF; Fri, 16 Oct 2026 05:31:16 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 07D0539D7F; Fri, 16 Oct 2026 02:29:14 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id D3F2C396597;
Fri, 16 Oct 2026 02:29:12 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nVWcVi8K"
X-Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 870FE1E0E14
for <git@vger.kernel.org>; Fri, 16 Oct 2026 02:29:10 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1792117751; cv=none; b=kRoFSXjhhArWuHI3SP6xmIqwzte/AiwNK5nCbDeY+xTbnAi+LaVyzhEjnkMi0S0QFlJZFFVtWclPN+pF6ZlT+7vK1JKQ0uV915OaozOSGh/GHfaRxmT1duRp0mEiDSjO3xs7VCblLTF8luGVCQ5gt5r+LBHj/LSiiV3TmBBanpA=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1792117751; c=relaxed/simple;
bh=WhpOIFCr6rI81ghCm6VOkXgftnwac2YDwNO6Mxpk74E=;
h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=PVZrAZkj9pQfBEW0DFPhSc9BQXyWegTIiaGzOMWWlIp04gXvyy63G+WflGT18Efy+3zk3o0apHwTuhpPBBRJ7tLoFe/xvHRWYUsjneNxVKL66WzIn4RqZu5qetRLrakXgWEU3K7HFGsbgtp2ZNlXByH9VL5rS/qLftpPFj+UU2E=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nVWcVi8K; arc=none smtp.client-ip=209.85.167.180
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-4b190cdc9feso3678544b6e.0
for <git@vger.kernel.org>; Thu, 15 Oct 2026 19:29:10 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792117749; x=1792722549; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=MdsoSSziCUD3qxrZABX2+evRXWaI9/r9cerHlsFIuLE=;
b=nVWcVi8KwoU7Jk+rlyx275k/md3LoJaYV0r7X8liHur0S1KNht1xH7JTFBvwTazeKf
m5GmjJ1N4Z0QG+3ZDAj732mDs/TSayPLDHRSM8qNUGGIf8tKv2Hc5lBGsqW4liVekOLo
z0tOI+pzWx7VEmZ6oYcvfqYNqmKSkL4s1qwr/lzxjs9gr2FNBAk89I8Kdy4W5Z7QbwLP
X8aLZEcZcDopG96Nov65pM7I1eWJnmoThGPU+B813jclVUdFgW5BT/SPHpVDz9cGEkb9
0hrQPS352Y+++QQpfP2zCsYdWhCjyy7jy+uDS4z3xlOGbTxbczUZoeOurBTJcCVyhZaH
QTjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792117749; x=1792722549;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=MdsoSSziCUD3qxrZABX2+evRXWaI9/r9cerHlsFIuLE=;
b=ULn1oPb7TlDKprdQhIqM1+piLysOiJ/0pe9F5MT2iV18KHlykgcyYcqS+hCw+lrwO5
/Cu1QLxUWRdgR/mPsxWvnKOYnsh7Uv9VjxPkZDWC6FxwBJeNCMdsrrlCwM29Aq/cA5Wt
TVR2jgJWI/KAwR750c8e5sBgDdbkyuOr5QO+b7LvWZthWtY+couAJvn5bKd7CSRhmVFD
3zW7r9I8jO6tX5SqDGghfOUh6yuZyidY3dhoIjG3y7gMusZPOp2QM0d161fk7Cb0duqK
tmsKrHFv4f1kYG2cxYdfqoknKDd2/ykJD5SoLth+EHYPtwuw/1ilz9c0dJ5SYkrR3d3K
429Q==
X-Gm-Message-State: AFq9FYJiRKc7Se4xE1h1BHx4X1oYE89NmuF/Nj8mBCap4ftl6ZTq2Lri
PqxVslnDpyV7SxdnU6cVmTSNWBGDNCbGxAScgiZTQeMKUGBWLY6TPlBfPEpsJQ==
X-Gm-Gg: AYBFou3+GdM2zu5rE7qvIKKRGONeBsjWUGhZt96dFS5o4lQ0/MgPBvmjWG+Hmd8WLCt
VAQCZNCNoyqUqN4Ok6EVMa8r3FUGMFFo2Ue9M+GY7T32gkuIaf+MVmFB4NsgBjZJm6H81Pj8lA4
1pFJXfBO1lyWKsG41h2YLWhp5fGvYuDoiA8X4ushc3ZGJeP8p3ufepWObzNmcZcAGGfGSaLu7dv
ZsrV5kPbEOvbeCZy8h/JVYiEc8nM0upxx+IEcrrJsNYL91QAJYCoQJhvEjp7zvZqhkT8Y9AE1dj
OfcclW0b/qjxz484Jb7qhxUW6Al6ONi4M0fZag6AFmK7+rRonOoOZmEuPHCRuI1OAQ/4adH/dgX
2KPCbSGE0mH/kCJkVKilJR5o1JAXguPuOSyWbRhckEwXKPWbcERdyB44Vo75uMdqseRyaxdc0bV
tbjNi5N86263Mvod+mKZJQZTGuXMRSciinaj25kk0riLbhkL3jnBmUG301ts2FzcXkNg2tR6u6n
1aW68EjJb6pDBVBKUpEexs2u89zMQNqtGcg3g==
X-Received: by 2002:a05:6808:1918:b0:4f4:3f10:830d with SMTP id 5614622812f47-50c5b27c152mr21956290b6e.53.1792117749257;
Thu, 15 Oct 2026 19:29:09 -0700 (PDT)
X-Received: from denethor.localdomain ([136.51.44.64])
by smtp.gmail.com with ESMTPSA id 5614622812f47-5388a5572a9sm506284b6e.4.2026.10.15.19.29.08
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 15 Oct 2026 19:29:08 -0700 (PDT)
X-Cc: Justin Tobler <jltobler@gmail.com>
X-Mailer: git-send-email 2.55.0.424.g13c7afec21
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>