From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796036632; b=SHZjlUQvSXgRbI3ODJO2jZXC/QTSKwRIv5ZiyzH2ZBFmaTetljxmucy1suVKFDsBut8o R0QEmanbQol+oCfjiJuuJZNSdnfAgWRDeInTwb4cSCnGldVo/+nbInXzc+orr57gTOGvQ Oxsi4UFYGJAINxJSgMSbOSFBKWPgXWwJugiH7WmyOG8HIbT80UGhPUGV2SjK7C97q1Z3O ZjWccGwnQffmivG/3ENWL9zQqqQpLXPoRB0VWuQ1olPCOJ/c9vrz3ddPYQGm05CjuWT+d rb8hZD3I54DunFbG47M6BQkXPAhYjTO2OaPXhT2YLEeYi+txhpT12duDBkaXx07Comg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036632; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=dg6M1oTrai5wpBHxcZv9gtoYokVLb+POHtQqwOMr85k=; b=h+tAPneWRYPKO33wYM7CM0buk9Oto0Ox0X/YYgAmX0pjqfm6rbdXnvrF0wXD+wagtUPI tGHj5JXWPlsonENS9y5RJbvskLJFq4g2BHsSDXYY2joMZc/ziSFXG0L1mWpRf1mfq8D6e VJyWJNKOw02QbliaYbfj3UzhzszhMb7/6xxLDpVsOyI8deML2q77m40DFHRKLOLm9hLIh ifZuR/z6qFk8tLuvAqhLaL6miacJEUXHPENB+cnmojli8rMmdXus5eFT7rpBWagAQn5uq +WSrqPqs604FUkOp8AA2NVZPkPyTOqzjkwcJqgcPWJJ11FlMibFkkQizAVz6hwuMdXA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EMk8R0Id; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DACF8606A32D; Mon, 30 Nov 2026 11:03:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=EMk8R0Id Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16E4B1F0093A; Mon, 30 Nov 2026 11:03:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796036632; bh=dg6M1oTrai5wpBHxcZv9gtoYokVLb+POHtQqwOMr85k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EMk8R0IdLvf0MHQj/Kei7lv90ZhEHES9qOwmIe24A3mmnzYSGC6+xMM91T45DnjVI 02ws6hOqwehxQ9eCSii4jtElmCUeGZvNVrarg6MuKh2xR/GMZMEnIRhww68l9JUxI5 CZzWm3ygvWB8kk+UqpzuVC3D1HiVj5YunnzwXrFcSAfzm+wtJ8iTl2hGWNsSj1PNIs uDpBuKjpKFW8e/ENfNifeSEJi2zgDaiBizYkiVGTb2cdoh2aLK0bONrU/0Ov5ZVBRN cZ6K/RRshzWdDcN1NAwGwJQgLoCDQbExnMQrh1bcnvZGUbkN/f1vDMppgKeZg+I6LR udF9vL0+d7lRg== From: Anand Jain To: fstests@vger.kernel.org Cc: zlang@kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v2 06/20] fstests: add _require_unique_f_fsid() helper Date: Mon, 30 Nov 2026 19:03:08 +0800 Message-ID: <20261130-f_fsid-v2-6-c11fd1a5eaeb@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261130-f_fsid-v2-0-c11fd1a5eaeb@kernel.org> References: <20261130-f_fsid-v2-0-c11fd1a5eaeb@kernel.org> X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Add a helper to check if the target filesystem supports unique f_fsid tracking across cloned or snapshot instances. Certain filesystems like XFS, Btrfs, and F2FS ensure unique f_fsid identifiers per filesystem instance. However, Ext4 derives its f_fsid directly from its superblock UUID, which leads to identical f_fsid values on cloned images until the UUID is manually modified by userspace. Introduce _require_unique_f_fsid() to allow test cases requiring strict f_fsid uniqueness to skip gracefully on unsupported filesystems. Reviewed-by: Zorro Lang Signed-off-by: Anand Jain --- common/rc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/common/rc b/common/rc index 47079bc0c60e..52f884902c7c 100644 --- a/common/rc +++ b/common/rc @@ -6495,6 +6495,33 @@ _require_fanotify_ioerrors() _notrun "$FSTYP does not support fanotify ioerrors" } +# Skip the test if the filesystem does not enforce unique f_fsids +# natively. Checking this dynamically requires recreating a clone +# layout, so we use a static lookup based on FSTYP. +# +# Across all filesystems, a UUID collision causes libblkid tools to return +# non-deterministic device mappings. It is ultimately the responsibility +# of the userspace utility or use-case to enforce uniqueness when a clone +# diverges. For details, see mailing list thread discussions: +# Link: https://lore.kernel.org/linux-ext4/20260409131238.GC18443@macsyma-wired.lan/ +_require_unique_f_fsid() +{ + case "$FSTYP" in + ext*) + # Ext4 derives f_fsid from the superblock UUID, meaning + # clones share the same f_fsid until their UUIDs + # diverge. + _notrun "Target filesystem ($FSTYP) does not guarantee unique f_fsid on clones." + ;; + *) + # Conversely, XFS, Btrfs, and F2FS ensure f_fsid remains + # unique per filesystem instance (often by deriving it + # from the UUID and underlying block device.) + ;; + esac +} + + # Computes a percentage of the available space in a filesystem and # returns that quantity in MB. The percentage must not contain a percent # sign ("%"). -- 2.43.0