🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #3254

Re: submodule: linked-worktree submodule hits BUG() in validate_submodule_legacy_git_dir()

#3254
From: Adrian Ratiu
Date: Tue, 17 Nov 2026 17:45
46 lines
10825 bytes
Hi Andreas,

On Mon, 16 Nov 2026, Andreas Wendleder <gonsolo@gmail.com> wrote:
> With submodule.recurse=true, switching branches in a superproject worktree
> whose submodule is itself a linked worktree of the submodule repository
> aborts:
>
>   BUG: submodule.c:2414: submodule name 'sub' not a suffix of git dir
>   '.../.git/modules/sub/worktrees/sub1'

Thanks for reporting this and for the reproducer.

The BUG() is older than submodulePathConfig. Users could not reach it
before 9cf8547320 (clone: prevent clashing git dirs when cloning
submodule in parallel, 2024-01-28), which made submodule_move_head()
validate whatever path the submodule's gitfile points to. A path read
from disk can be anything, so it should never hit a BUG().

Your reproducer needs the second worktree because the gitdir ".../sub"
happens to end in the submodule name, so the check passes by accident.

t2405 sets up exactly this layout but never runs a recursvie checkout.

I'll send a fix.

> With extensions.submodulePathConfig enabled (repositoryformatversion 1),
> the same commands no longer crash but die with the "refusing to create/use
> ..." message, which recommends enabling the extension that is already
> enabled.
>
> I would expect a linked worktree of a submodule's repository to be
> accepted as the submodule's git dir. If it is meant to be rejected, the
> legacy path should return an error instead of calling BUG(), and the hint
> should not suggest the extension when it is already on.

Yes, the hint is actually my mistake.

I have a local fix which I need to test a bit more, but makes your
script switch cleanly in both modes and the main submodule checkout
isn't touched.

Will send it in the next few days with you in Reported-by.

Thanks again,
Adrian
Technical Details
Message-ID: <877bibjqrv.fsf@collabora.com>
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-75625-linux-kernel-git=dewy.ru
References: <avuJBGlB3pRU3JU0@pampelmuse>

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-75625-linux-kernel-git=dewy.ru
From: adrian.ratiu@collabora.com (Adrian Ratiu)
Newsgroups: linux.kernel.git
Subject: Re: submodule: linked-worktree submodule hits BUG() in
 validate_submodule_legacy_git_dir()
Date: Tue, 17 Nov 2026 19:45:24 +0200
Organization: Usenet Network
Message-ID: <877bibjqrv.fsf@collabora.com>
References: <avuJBGlB3pRU3JU0@pampelmuse>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: usenet.network;
	logging-data="2391873"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:WLyd4QR4nVQwA4I4AtL7HprS1aw= sha256:1PrpdqPTiH3QYbaNBDVkKZ3orDQlrcqJ27NhQCbRJM0=
	sha1:mtMrhBGibuyliR3ej5BadFgNht4= sha256:uYEE/n0wmbvFTos8SRvLS1L3SKhDQOkYdtNtf9yYyjA=
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 65913115027; Tue, 17 Nov 2026 20:46:00 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.75
X-Spam-Status: No, score=-2.75 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=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=fail (1024-bit key)
	reason="fail (message has been altered)" header.d=collabora.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 xiwJddsY4tMk;
	Tue, 17 Nov 2026 20:45: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-75625-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=collabora.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id E5AF4114FFF; Tue, 17 Nov 2026 20:45:48 +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 7A6E9394EF; Tue, 17 Nov 2026 17:45:34 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794937534;
	b=Rfvrmddb56lLZcGpLMQhACagkJ/FhioKVakUhGsLQW6R2duFhwrrLQ5clAvD7EFgdvTf
	 qxLfDydLrfgPbJ/sPQtXF2/SBxGb9Q9mHYUsy+c6O6h0aU5AdPYjPAFQrX07zeNvfxvYC
	 ARH7uyMxyfBQbgrfvUFvncDn8iWjaWKEyoJXFvcmUjqBkULYarT0Jt9UZi0GyBQHj5E3J
	 kr9w6vrQGAHwvKp3pN1N3gpjImehUItG/P3Uek5XieeamPWpStJ8F0j/ju6/jEV1FGUV7
	 dOWA2oBOCW3Xw43TWvxnJ5eIbTvvwHIGe+SA8/yh4Crf4cIO1dz9D7PdMk13kPhDulA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794937534;
	h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To:
	 Cc:Subject:In-Reply-To:References:Date:Message-ID:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type;
	bh=PbMAmiGxaMXwNDerF8ykGmehoG71UZZnnTVT9TyjMn0=;
	b=UINGQDuF6x6qrvs0i0G5pK/JDFVKE7Wwf5F5WRDSx0amcnkWNwBcylTO1XYm2VW14tNX
	 +wPXutu/b2VX/rEcLj4plvAEch5QUGcGBzJ2OmBTVIhiiyUEYkcO8Ae0xAUbaGoHH6md/
	 48F1X/9DxUwihx7a8DN1pz7uYf3j3CDau5BA65YKUsaYA2+WPMqezoyWw/y/D0G5yJ4qz
	 q1T5Gy9pu7PoDXthHGLxXcRZrkPpZrmYi1IRlw6Ei3GSaoE5SYzaIbsLgiPrLfdkJxX5s
	 YxBEnFzu7lkyenNy+axSJr4TwHgfbXBp466qcpYzJr8O8L0iDcuf368mAN98nOphhgA==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=fail reason="signature verification failed" header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=b1PgZAH3;
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.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 5192F606A336;
	Tue, 17 Nov 2026 17:45:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=fail reason="signature verification failed" (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=b1PgZAH3
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.12
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794937533;
	b=XpLzD7UMs6gip7YpYf74pKtBOjrWpjWSFKgJllQPsZ7zlMLLrOF4/0NRjHXFyIKYTGmJ
	 DxupI/+EQLjluTvXR0jcMd7D0GainQZm9yy2YKhp01P5ssgngQztc1ilxcn12/gngR3An
	 Yhz+DbuUaasSp4SJGxvC0Zhsp/LWsGOpJ8UfIfPCOisKWQbJIJY4WfNuHYFOKlCtPpBVf
	 f+UT4HDxYIy8MC3F+CEVJq4BjwIbG5tXaa+gJmjDz5Ku8XaF4cEFqI5MfyPcwBPe6k0b/
	 vBq15bDPLqFqH1wmqnUBOXySCVSj8YLCmWYxyvqSU9Hzxr2dItg+VP9fyKOmzhgao3w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794937533;
	h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:In-Reply-To:
	 References:Date:Message-ID:MIME-Version:Content-Type;
	bh=PbMAmiGxaMXwNDerF8ykGmehoG71UZZnnTVT9TyjMn0=;
	b=11fxddFbh008AzVSHhF9Fs8NBIP1Ns9Hc4RkWz60ScbL6wCmup+PE2WshYyaZlKgSszi
	 SJ36SXQYI9NehH2uSqleKjIYYUL0jtxmquoLYdFYX+djLkHxI2guYldrGbRTqtZULHQEa
	 gEcYxBssyBhjurW3PMV34bOt2xl96POhYn53FAW1z53+cp41+a3q0JqP3syNfQ0ug85AB
	 kyDM//2w/67G+yAZfx/l3c78ZpSvLKKBy3sIl8zzCkMICldSd2SPY9cz1/uSs3T3mwbLe
	 61FFbdrW6PwYOQS4V4xOgx6y8soiCsOWEqfIGhT7Tw3BR3x5iW/BjbUBuqG0qOj5hGw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=collabora.com;
	spf=pass smtp.mailfrom=collabora.com;
	dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=b1PgZAH3;
	arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.12
X-Received: from sender5-op-o12.zoho.com (sender5-op-o12.zoho.com [165.173.182.12])
	(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 0B5C5606A31C
	for <git@vger.kernel.org>; Tue, 17 Nov 2026 17:45:32 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0B5C5606A31C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com
X-ARC-Seal: i=1; a=rsa-sha256; t=1794937530; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=XqhcHnRdUJI13aE2keLDjDmhz0phyalaGtY6yNoRLJ0n/Fb0sbPd0lYzuxQIpYxoAb1//TEmAwRPCexPsrPMWboSNpUgqaVHWulQ0mjNuVCvrIu2yq9wHj12VE8aZScJCdSb2eHoSRYKcJklLHvl2t9h39XympOie/0XF/0GcoE=
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1794937530; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=PbMAmiGxaMXwNDerF8ykGmehoG71UZZnnTVT9TyjMn0=; 
	b=e8QowW4FHck+syjr3sabYmNj9yAKJlkcbNT1gBT0dYHwCIR0iD/PCIGtCEzdoBu8YlxkM4GmsqXJmuY4e79zc9M/Lsrmza/BVtj77cnlcL3vkmR7eVnJLpiKr5leFHgw4AilKcdXy53JZ6CydaLU80V1oqK91+oeYy50t2QgFzY=
X-ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=collabora.com;
	spf=pass  smtp.mailfrom=adrian.ratiu@collabora.com;
	dmarc=pass header.from=<adrian.ratiu@collabora.com>
X-DKIM-Signature: a=rsa-sha256; b=b1PgZAH31cPhjXrGNUVtF7WKKo55kK1b2bUauGIk9s3MbIxkkRNDSaErMcXFXZJUikIDLWoEGJvIy4NpwrFioc7n+ukUS62oiSRDG+emROdAR6lhScbrFK/BcLn6rVy4TbpJclWdLg+nfXmEFsV9sigYP48oYxYhnXdTdj64pSs=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=PbMAmiGxaMXwNDerF8ykGmehoG71UZZnnTVT9TyjMn0=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc;
X-Received: by smtp.zohomail.com with SMTPS id 1794937529241716.655719631649;
	Tue, 17 Nov 2026 09:45:29 -0800 (PST)
X-Cc: Phillip Wood <phillip.wood123@gmail.com>
X-In-Reply-To: <avuJBGlB3pRU3JU0@pampelmuse>
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