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=1796036643; b=NVJWGdmloa+053dlavc7ScSfsx4XFE7z43Nn4E34PNQCLPfe4ZvLtKjwbaeito+hKjdP cTBpUvojPsPqDbQhv7kL5X+uwFP0nZ5g6+/iYL/PKNRJtDENZ8s6HxM1ZCw40QuabWv64 FmuxpkCXYfRIRxUuS0yl3KDKdSECV0eKKFDmmEubolXoRfMk1LnL0zA+iPOFevLmaDuFZ V8XDVQDftPOsqUUHeIUflMLUeNKtTMEoYNLVfosj3pyoJguxOhol16+SK3ImifMNEkKoZ DBCnZLbR1m9p3xJWDR+40IVC6N/gFaFjBCnXW/MYOBhb01TlvoqD3Ewa8b0/ldilEVw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796036643; 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=4lbHDAzIPdbM68Bj3R3pHajy9358/LNyvaEAm6jnz8s=; b=EizjqZ5oRZMNbzsZyvb7MBC4glK6vmtvEUO//HkzDQF84HxcMC/HLJa9vby/BWCEUnKt p7935ogVTL5ajMZ85EngR6SpcWpAL5eCRpIVM8hewjoXZAay1BgAAwHmYuyPWD2d3KFEt dhHfWty1Nq3ww4hk6p37EZC1EBhK8r2gDAJ3LSTrRXtH/IKr4T1ympMJ/mfEOKsIgcZKr CHgT40P9H/YFKL/jzfXAPmDz7B8A2X/QCM98zgXTc7bHBNZrwHEReAipaOrXUlZeupj2j rU4ZBAe+wX/XAEHUjh7oLNKM954fWvBfeZ2OxblAONeSp+iDWXunIWEis3baes+RwXQ== 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=b5GBUY7Q; 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 0023B606A32D; Mon, 30 Nov 2026 11:04:02 +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=b5GBUY7Q Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90A1A1F00899; Mon, 30 Nov 2026 11:04:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796036642; bh=4lbHDAzIPdbM68Bj3R3pHajy9358/LNyvaEAm6jnz8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b5GBUY7Qie2BHkUnPuCFsT55SW/wCAqZOinErvBDi0twFhIccuXfmtv3Nam/16bQd 1Ke6zuWuy3karmvdqxh38Gc/+sVacURZC9HKu1F6KDrJb+vLZR4jlNx0ArX6EH66ez d+rq1lizLCErN5yFxrwDiTcZeC1qg3qHKdo7I0LRug6JE1ou1BLzXR99Vzz9c3USVP ekzGvnrxGoXD7zaqQlJzvmP5DTVYW2LUaJgjMB790e7xeGne1HIYgrIRNpFm+x8BXv VT8cy4BRAgum3lAPw107e3ZWR8BL8oWNW9SCVHN9v8WWLD5DRzqm6ZTEXDNxcs0JwV 7QENoCzjuo1vA== 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 10/20] fstests: add helpers to verify the expected f_fsid Date: Mon, 30 Nov 2026 19:03:12 +0800 Message-ID: <20261130-f_fsid-v2-10-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 two helpers to common/rc: _require_uuid_based_fsid() skips the test unless the filesystem derives statfs f_fsid from the UUID alone (currently btrfs and ext4). _scratch_expected_fsid() prints the f_fsid expected for a filesystem created with the fixed test UUID. Reviewed-by: Zorro Lang Signed-off-by: Anand Jain --- common/rc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/common/rc b/common/rc index 6f09739c3dba..5d28f6b3b780 100644 --- a/common/rc +++ b/common/rc @@ -6134,6 +6134,37 @@ hexdump() _fail "Use _hexdump(), please!" } +# Require a filesystem whose statfs f_fsid is derived from the filesystem +# UUID only, so that it is stable across devices and mounts. +_require_uuid_based_fsid() +{ + case $FSTYP in + btrfs|ext4) + ;; + *) + _notrun "Require a filesystem that derives f_fsid from the UUID only" + ;; + esac +} + +# Print the statfs f_fsid expected for a filesystem created with the test +# UUID 12345678-1234-1234-1234-123456789abc. +# Must be guarded by _require_uuid_based_fsid. +_scratch_expected_fsid() +{ + case $FSTYP in + ext4) + echo "4c44000088884c44" + ;; + btrfs) + echo "444c444c888d" + ;; + *) + return 1 + ;; + esac +} + # Try to create a file with inode->i_blocks >= (length / blocksize). # There may be some small overhead, e.g. ext2 filesystem allocates a # substantial number of blocks to store block mappings. Those are accounted -- 2.43.0