From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 AD3D32D0625 for ; Tue, 14 Oct 2025 21:08:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760476124; cv=none; b=UgnZHfeNYpfdxoDTwI4XN7nL+W5SgnLCHnsvqLYCidpSe57k8Sa42S4mh2bkppU3OrLKD5Aa+WpW3mNfwoUiaP8mnUxiOrpZXvWENHYcO9/dubmGP54xGMKEIz+wYvDXTbdX+FntnyfH+KXDml6gQf/zJtRLr/Qtv/a0RqXR4Yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760476124; c=relaxed/simple; bh=cnJtV5UStc6Ve+q6PTyQ+wuRR2r/C1//Qxh9geDvSXE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=J1PaldXPKcO68qLQb1AGHKb+XqHYB2RlYc3UuLtcSyqdRNHTN2LwwccTAgPlOzFNsk9k327XwJWuX4kLDZKANKzomqzOQ6usNc9K2NC+5VYi9HzdSrpqUi/Du8wMgEOR3bJimOqNsjT2oMKiNzP8An1QiInFohai/A3D2k0ONnM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=Lfw1zTrq; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="Lfw1zTrq" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-426edfffc66so195474f8f.1 for ; Tue, 14 Oct 2025 14:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1760476120; x=1761080920; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=siBEdSXb+TOq19NSx1UjT5CHbXYzR/FE6uFr7iLMMvY=; b=Lfw1zTrqg30dCP1eGdjNWY1Sg+fLzbbnCj2N5NGwOLbjEQH3ttPTbko59Y/Dm7AqC3 8Az4V4TIVgwIf9OjHF7tACJhT6HNTkOdq/8UwZXkKv4vNmABEYfHbVQRLVVkhIr/SZEF 9Bkl/jurIDeDJ9TZUkZb07rFBjelYmG04ffr+lSduAlrXyn+oUDyydpibupUaaEPLb2z /9ZKbWURBaP3hsVK7AZVL9KFBBq5Rl82rV7czuwyF2GLS3cFSUXSfO93VF2aqAIW9QdL H1eftBtweRms6ZTY/VTz9tHN8JSpkPvepNFbg7bmyOE62pEBpGvz403YvkiQIzi9zOvj defw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760476120; x=1761080920; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=siBEdSXb+TOq19NSx1UjT5CHbXYzR/FE6uFr7iLMMvY=; b=VnWJqV1IuuEiiMeMj3xb6m62kqfbyGC4m5IGeaqqOyQVmyDmEGj6IJwSk4IoUYKDD/ qFuE2kkY1qgwZV+9Wn8+LoNlfKc3fZSOPrIaqzQ8fNCGkqYh8No9+DJEX0mJvBUob4o4 vHvZj3Pvm5ezyIPU50rF4HtrTESrp3BChlgYwgewMnxkE1HawVa49E6EruKC+w62Q/iN r9S4L4CBuDMA/v5a9NeIZWAriOrSQay1CWS7RA72GQgjPto8MhDTyWSCqbOAXlkf669i L0f7dIRFhAIFdEE2Z/MATutDXNUIgDPDF8V9Bxl8tjRs0Bq85JCWTKUu2JxE+f1mBfjn hFkg== X-Gm-Message-State: AOJu0YzqRkGPADoTFv6Sx7kkooGDXDRgV/fB3DRj+h9C+dHL7oEMh4LW y2ichASC8tWfLDL+pdajz+R6PK83mEvh7626Jz8CKWeOG74NUdYQNwxZCXw8Y/d8dfA= X-Gm-Gg: ASbGnctczABpH+d6faLyYMPUSM89Pm+gPxVDHXN+XEb7QVMKy/vXnHM73w3lmJYqiLR 27/DSZJvqXGoPa6BwOO2xY6OL4ZuJPW96M0ham5gI7Dnug2apZuAw+ISymUSfz92DiGJuQBtMPc MtxgiNldx6BTI8Xx6n7B+QRtOS1st4wz7c96ZOO6hM1J7iBq92wC5vHBrxadejZTyF9cwoJ6W+D nolyrVJBQUr/UXEoTYGiRgdjQioWkRiWZH/ZP3dGKCFTQRZRURJaBFMtPE0H+yhVYIaiczvswlw /CqswWSr5jU30y55pi68qh6ls0lk8HRqLhdtoMAWR+In8ivqjf3Kf3BAj5KMzmK/QIQ1kEitKeg 3xj1i9WNC7Detsc9hnv5wISbfmLhnfK2pFqCcAkYb0Llklr3ZTMYWWdMjLRap9nrlYFssknkNXC XemUPs X-Google-Smtp-Source: AGHT+IFIANIwScg+5GHJALy/pEalv764AKxh+pONr/MZ4Z/a40QUVzKfGvCzQ2ZGEWok1LqkLwNKLw== X-Received: by 2002:a05:6000:4284:b0:426:d30a:88b0 with SMTP id ffacd0b85a97d-426d30a8fc8mr10165982f8f.22.1760476119851; Tue, 14 Oct 2025 14:08:39 -0700 (PDT) Received: from ?IPV6:2403:580d:fda1::299? (2403-580d-fda1--299.ip6.aussiebb.net. [2403:580d:fda1::299]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29034f36738sm174176085ad.87.2025.10.14.14.08.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Oct 2025 14:08:39 -0700 (PDT) Message-ID: <6982bc0a-bb12-458a-bb8c-890c363ba807@suse.com> Date: Wed, 15 Oct 2025 07:38:33 +1030 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/1] ovl: brtfs' temp_fsid doesn't work with ovl index=on To: dsterba@suse.cz, =?UTF-8?Q?Andr=C3=A9_Almeida?= Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-dev@igalia.com, Miklos Szeredi , Amir Goldstein , Chris Mason , David Sterba , Anand Jain , "Guilherme G . Piccoli" References: <20251014015707.129013-1-andrealmeid@igalia.com> <20251014182414.GD13776@twin.jikos.cz> Content-Language: en-US From: Qu Wenruo Autocrypt: addr=wqu@suse.com; keydata= xsBNBFnVga8BCACyhFP3ExcTIuB73jDIBA/vSoYcTyysFQzPvez64TUSCv1SgXEByR7fju3o 8RfaWuHCnkkea5luuTZMqfgTXrun2dqNVYDNOV6RIVrc4YuG20yhC1epnV55fJCThqij0MRL 1NxPKXIlEdHvN0Kov3CtWA+R1iNN0RCeVun7rmOrrjBK573aWC5sgP7YsBOLK79H3tmUtz6b 9Imuj0ZyEsa76Xg9PX9Hn2myKj1hfWGS+5og9Va4hrwQC8ipjXik6NKR5GDV+hOZkktU81G5 gkQtGB9jOAYRs86QG/b7PtIlbd3+pppT0gaS+wvwMs8cuNG+Pu6KO1oC4jgdseFLu7NpABEB AAHNGFF1IFdlbnJ1byA8d3F1QHN1c2UuY29tPsLAlAQTAQgAPgIbAwULCQgHAgYVCAkKCwIE FgIDAQIeAQIXgBYhBC3fcuWlpVuonapC4cI9kfOhJf6oBQJnEXVgBQkQ/lqxAAoJEM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JoAXek8MF37R8gpLoGWl41FIUb3hFiu3zhDDvslYM4BmzI18QgQTQnotJH8= In-Reply-To: <20251014182414.GD13776@twin.jikos.cz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2025/10/15 04:54, David Sterba 写道: > On Mon, Oct 13, 2025 at 10:57:06PM -0300, André Almeida wrote: >> Hi everyone, >> >> When using overlayfs with the mount option index=on, the first time a directory is >> used as upper dir, overlayfs stores in a xattr "overlay.origin" the UUID of the >> filesystem being used in the layers. If the upper dir is reused, overlayfs >> refuses to mount for a different filesystem, by comparing the UUID with what's >> stored at overlay.origin, and it fails with "failed to verify upper root origin" >> on dmesg. Remounting with the very same fs is supported and works fine. >> >> However, btrfs mounts may have volatiles UUIDs. When mounting the exact same >> disk image with btrfs, a random UUID is assigned for the following disks each >> time they are mounted, stored at temp_fsid and used across the kernel as the >> disk UUID. `btrfs filesystem show` presents that. Calling statfs() however shows >> the original (and duplicated) UUID for all disks. >> >> This feature doesn't work well with overlayfs with index=on, as when the image >> is mounted a second time, will get a different UUID and ovl will refuse to >> mount, breaking the user expectation that using the same image should work. A >> small script can be find in the end of this cover letter that illustrates this. >> >> >From this, I can think of some options: >> >> - Use statfs() internally to always get the fsid, that is persistent. The patch >> here illustrates that approach, but doesn't fully implement it. >> - Create a new sb op, called get_uuid() so the filesystem returns what's >> appropriated. >> - Have a workaround in ovl for btrfs. >> - Document this as unsupported, and userland needs to erase overlay.origin each >> time it wants to remount. >> - If ovl detects that temp_fsid and index are being used at the same time, >> refuses to mount. >> >> I'm not sure which one would be better here, so I would like to hear some ideas >> on this. > > I haven't looked deeper if there's a workable solution, but the feature > combination should be refused. I don't think this will affect many > users. > I believe the root problem is that we're not fully implementing the proper handling just like other single-device fses. We do not use on-disk flags which means at least one fsid is registered into btrfs, thus we have to use different temp-fsid. If fully single-device feature flag is properly implemented, we should be able to return the same uuid without extra hacks thus solve the problem. Thanks, Qu