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=1796036645; b=ozD1UMq7fw21SAFho1j7PVWNm9/yhW/psKGoBxY2pK9noiCE56789pwc7D+zGyWc/u6E Inhn6/Px82kkMag16jH27CRY4MSwuRERgG6JE1MFUtlJTcYzOZ2crIIySlqeGAFJShJKV nkdRqth0fHn4pDp9D4mNIV2ya6Qd6n2lR4ZP/wb9ee6Ai0VravjHJqaaX5rG4Lbbe5UYL VrvmCtUpwHqhnheezWI8EvdxiOYYpWOd/b6/SBM2HohYZZi1t5UNPWtXShUEUJr18bbDt QQXV0alQeuRfJEOoTJ2J1AEaMlN2aUkYRgqMNv6SeoGU9pRoyUqdLtogCYQNt11c9Dw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036645; 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=/LDhiLd38xsZJ7uJorV0dZuUslkQYaTgUOfYs6UMpl0=; b=aiOZ8gHJaEHIgY1nAJN+uZwejU/HYWvoE61wlZOu5QO7KpPJInHb4AGtPhs4J+HWs9mF DTcsZ67d6EIyI2RuKJeyzmjDuJmA9irmteQcB+WBlszUa2RgXdeAp0bjfca2GXMV3QI0f BLxnIbwko3eMzozNte+1c1NHTUYG12Xec/mRkj5VjPlvbqvKvsY3TlBa8+QsAEhu9RSsP XBqKW+i42+x0txjfEbFREyb3+YjdDSxCL3HqPSxowJ80ko7IdMx+mGba9H5j4bsTkD+RK Tmxb8IE0QGEwRlNeV0ROxiTzgFaXVGVLHvNtFEB0zp46ie/I4tkEXkChzrAVo7hKGCQ== 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="E/VDbBkg"; 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 03FC1606A31C; Mon, 30 Nov 2026 11:04:04 +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=E/VDbBkg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10C0E1F008A0; Mon, 30 Nov 2026 11:04:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796036644; bh=/LDhiLd38xsZJ7uJorV0dZuUslkQYaTgUOfYs6UMpl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=E/VDbBkgHCidNPeFAzsF3YijIGbNNiLJYXwf5uWKSxVacjJml3QvVYzEtXEOyZSJL NId8gWiCqgu2qLrAuJpsZkUfzVbWsoSNnBk51DEsSpmnKViwtRTPSGlBkPZ2A5r5g4 JndYjAVWszP58WeYujCPvlXOw2ok/GAsQwhtqiFgoOpmTge/QtUDTeilCSBqaTu4SQ VrNnihXV5PgZxQWsZx9B8UdlEuAH1/+wAETYvW6XitS8esM9T4JBxCTR2bDC7avJ7y thqc0qEvGc6ROLC5am11GBnMC+rljHkvdfcgTlAI1HyVoQTJG99JsPEaiyLkstUbLT 5IILxosVqDrlw== 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 11/20] fstests: verify statfs f_fsid is derived from the filesystem UUID Date: Mon, 30 Nov 2026 19:03:13 +0800 Message-ID: <20261130-f_fsid-v2-11-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 On btrfs and ext4, statfs f_fsid is computed from the filesystem UUID, so a filesystem created with a known UUID must always report the same f_fsid. Userspace relies on this, for example fanotify and file handle users that identify a filesystem across mounts. Guards against f_fsid changing across kernel versions, which would break userspace that relies on it. Reviewed-by: Zorro Lang Signed-off-by: Anand Jain --- tests/generic/902 | 38 ++++++++++++++++++++++++++++++++++++++ tests/generic/902.out | 2 ++ 2 files changed, 40 insertions(+) diff --git a/tests/generic/902 b/tests/generic/902 new file mode 100644 index 000000000000..44dd685a887b --- /dev/null +++ b/tests/generic/902 @@ -0,0 +1,38 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2026 Anand Jain . All Rights Reserved. +# +# FS QA Test No. 902 +# +# Verify that statfs f_fsid is derived from the filesystem UUID. +# Create a filesystem with a fixed UUID, mount it, and check that f_fsid +# matches the expected value. Applies only to filesystems that derive +# f_fsid from the UUID (btrfs, ext4). + +. ./common/preamble + +_begin_fstest auto quick + +_require_scratch +_require_uuid_based_fsid + +_fixed_by_fs_commit btrfs 72de4807ba84 \ + "btrfs: derive f_fsid with dev_t only when temp_fsid is active" + +_scratch_mkfs_uuid >> $seqres.full 2>&1 || _fail "mkfs failed" + +_scratch_mount + +blkid $SCRATCH_DEV >> $seqres.full +f_fsid=$(stat -f -c "%i" $SCRATCH_MNT) +expected=$(_scratch_expected_fsid) + +echo "f_fsid=$f_fsid expected=$expected" >> $seqres.full + +[[ $f_fsid == "$expected" ]] || _fail "f_fsid mismatch" + +_scratch_unmount + +echo "Silence is golden" + +_exit 0 diff --git a/tests/generic/902.out b/tests/generic/902.out new file mode 100644 index 000000000000..e20395365cb5 --- /dev/null +++ b/tests/generic/902.out @@ -0,0 +1,2 @@ +QA output created by 902 +Silence is golden -- 2.43.0