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=1796036647; b=Z+NZi8aMIpbkXLj8WUbGy+CdZbT23Z1VFiwROVBkFDi4ps/7pI/OWipevokdZK7wYoTh Y3L392UJDwPYjVsVnUzdlzZ1mGonfExdirF5wrpNB0aHflshF3mBybSJOsokVniNHlJwQ cxGldO/MSwQkzPUCdqv5HFQyrLWBaFyFC6DSKq93EFTqN9t2Zq+HtXE1SP+kwgE2fnXdM ALL12mYRTyxGyviybjWpYDj4DAb4+7AqZa8+xadUj/V3BK7Ou4h5nX5kNOctjAZYGBGK7 6bM4vTmVqfdZZwkvpiyDs43YynsUKZK782A3C6UqyuIE42VgvDSwbGtrJRqy3+1vB3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036647; 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=Jpy2wSVkdjw6p94YCpr7Ytc7QkvWWy9M2QRan/vs2H8=; b=CtnL5G/5suesBiQTXkmSo/hYZN68e8ecS+Jc/8ib1hekfhOusdaq242S0TtNMv+l1PRa +bzods4FFipu9wKEXD6SCtkx7oz0yQyR1gkNLj5f3SS1seWfI4X9G41GEnAy6KECiBcN1 K5wYyZRSVFrIl9Xf3hOZ/sAnqPraCI8nJIX+H4uAGGlvkx8uEW6y2cnHaJgAiehx1sOfx H0xR073bWLa8vc45Je3yu2ct61z0CWCjq8njR+4XUknufxvHXqszCgIU+LxkrRvbj6aGH rvDMdQ2CuOZv76HjBpUtfpvi7KhxyST/VFUgI+NLkQTlmKBWp0RfwdbfZ+/W9Rojomw== 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="VjG/BzHN"; 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 B9000606A320; Mon, 30 Nov 2026 11:04:07 +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=VjG/BzHN Received: by smtp.kernel.org (Postfix) with ESMTPSA id D46231F00937; Mon, 30 Nov 2026 11:04:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796036647; bh=Jpy2wSVkdjw6p94YCpr7Ytc7QkvWWy9M2QRan/vs2H8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VjG/BzHNIoq/BeA3Li5AewMl72nbTz1Dl2kYjf+QbUyxAfEKRLt+ukpOVUiN+Lnet LOdaP5sKTophRIuVyGvuGTxgOzvgEPlSoK5UxTULLjeIR16ffTxgzP0aKpoRxzhn1+ yexwgGo6TU1Fx5eDnrYCAtP1UGlkao15HkC3WRc2OSOtNQzJYG3Bt3EnFnSlpWzAnL BoICFl4v5otED1aBcDrXrXe0OKkfd2nKbptwXETD0+KzHUXLZV5NHF6HIn+oQCRHU/ 0MI0wITIGZ0fuc3qbVwpUIk7Za31eFPGmPaNyPGOyfhG6ttSTkErtCNdFgs9BxjGeY +hSlsA9HEYPoQ== 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 12/20] fstests: verify libblkid resolution of duplicate UUIDs Date: Mon, 30 Nov 2026 19:03:14 +0800 Message-ID: <20261130-f_fsid-v2-12-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 Verify how findmnt, df (libblkid) resolve device paths when multiple block devices share the same FSUUID. Signed-off-by: Anand Jain --- tests/generic/903 | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ tests/generic/903.out | 6 +++++ 2 files changed, 77 insertions(+) diff --git a/tests/generic/903 b/tests/generic/903 new file mode 100644 index 000000000000..915a0a07f476 --- /dev/null +++ b/tests/generic/903 @@ -0,0 +1,71 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2026 Anand Jain . All Rights Reserved. +# +# FS QA Test No. 903 +# Check if the mountinfo based findmnt would resolve to the common uuid +# as per the blkid (libblkid based). + +. ./common/preamble +. ./common/filter + +_begin_fstest auto quick mount tempfsid + +_require_test +_require_loop + +_cleanup() +{ + cd / + rm -r -f $tmp.* + _unmount $mnt1 $mnt2 2>/dev/null + _destroy_cloned_loop_devs "${devs[@]}" 2> /dev/null +} + +# Normalize pool devices and mount points names +filter_pool() +{ + sed -e "s|${devs[0]}|DEV1|g" -e "s|${mnt1}|MNT1|g" \ + -e "s|${devs[1]}|DEV2|g" -e "s|${mnt2}|MNT2|g" | _filter_spaces +} + +rm -rf $TEST_DIR/$seq 2>/dev/null +mkdir -p $TEST_DIR/$seq +# Setup base loop device and its clone +devs=() +_create_cloned_loop_devs devs +mnt1=$TEST_DIR/$seq/mnt1 +mnt2=$TEST_DIR/$seq/mnt2 +mkdir -p $mnt1 +mkdir -p $mnt2 + +# Get the uuid from the source device +fsuuid=$(blkid -s UUID -o value ${devs[0]}) + +# Mount both identical UUID filesystems simultaneously +_mount $(_common_dev_mount_options) $(_clone_mount_options) ${devs[0]} $mnt1 || \ + _fail "Failed to mount dev1" +_mount $(_common_dev_mount_options) $(_clone_mount_options) ${devs[1]} $mnt2 || \ + _fail "Failed to mount dev2" + +findmnt --noheadings -o SOURCE,TARGET,UUID "${devs[0]}" | \ + sed -e "s/${fsuuid}/FSUUID/g" | filter_pool +findmnt --noheadings -o SOURCE,TARGET,UUID "${devs[1]}" | \ + sed -e "s/${fsuuid}/FSUUID/g" | filter_pool + +# Btrfs assigned a random uuid for the clone fs before the fix. +# Cycle mounts and reverse the initialization (source and clone fs) order. +echo "**** mount cycle ****" +_unmount $mnt1 +_unmount $mnt2 +_mount $(_common_dev_mount_options) $(_clone_mount_options) ${devs[1]} $mnt2 || \ + _fail "Failed to mount dev2" +_mount $(_common_dev_mount_options) $(_clone_mount_options) ${devs[0]} $mnt1 || \ + _fail "Failed to mount dev1" + +findmnt --noheadings -o SOURCE,TARGET,UUID "${devs[0]}" | \ + sed -e "s/${fsuuid}/FSUUID/g" | filter_pool +findmnt --noheadings -o SOURCE,TARGET,UUID "${devs[1]}" | \ + sed -e "s/${fsuuid}/FSUUID/g" | filter_pool + +_exit 0 diff --git a/tests/generic/903.out b/tests/generic/903.out new file mode 100644 index 000000000000..7683506e1c94 --- /dev/null +++ b/tests/generic/903.out @@ -0,0 +1,6 @@ +QA output created by 903 +DEV1 MNT1 FSUUID +DEV2 MNT2 FSUUID +**** mount cycle **** +DEV1 MNT1 FSUUID +DEV2 MNT2 FSUUID -- 2.43.0