From patchwork Fri Oct 11 01:45:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13831936 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1216F10E9; Fri, 11 Oct 2024 01:45:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611125; cv=none; b=i8o1fY5cqca5oqReXkDKkWUaD0PufocwoHsHxtWIk0BoNmZRn7xF+6UiOZcF64YEBbqHd3jnOsOOSbla8UVtY20SlGFigtsk0T749hIKOr8Vzd9dDYBtDRBuGWTS+ORi/r0l1K3q19yKoGGgqXnDtNv86xGr30PI3hhxgKA8/xY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611125; c=relaxed/simple; bh=6ufvS2BdbchJ7il6c/Tcb9EZj+BexSqh1IitcvCunak=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WB1BKtZg43yjnDhNqxvdFwjEeR95XZbMc1joXZXMpbcj4xMnJd34/pgGoOSlz1qylmSgEaYOt1kJCp/TUv3mu7CJ3CR/Bbij3KlLqdP85nZjYsSjhDZqmQKiu0GzsIn4+gw0E9tVX5hF2Fx4lm5u9Py6g9J4haSWpB+UX8uBAzQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ymc25nC8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ymc25nC8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE554C4CEC5; Fri, 11 Oct 2024 01:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728611124; bh=6ufvS2BdbchJ7il6c/Tcb9EZj+BexSqh1IitcvCunak=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=Ymc25nC8qa5mPWFMKSOBBiJpU4ngBAPFLSXcNX55PWgZH56/Wmm8K5QhzXTQR/A1W VCnm11HZX7xwNrdOpmgMNH6y6o5RNjO9Nbnm/cNtneFAOXEfhtu9Dcy1/RFU7nmk2P EW+GEF5XoNLwHAxNlLnsuTOnQ+xx1i8AjM/IFhYKrllhaBgAK2UaUw8eli0PjGKkbJ 8R7IKXGo0Ot6xqsktyPXjvqJmmGFNnm0r+2vhSd6cA0atQ6Sp80lxPkSi6iMc/Bi/L W+cC6pTO6ENWlsIcS2PFQmvMtwCW5Tb3x6WYm/GvACHy1GZ2U/gN2CkZ9LRythnpQr oeOYrF8/tEHeA== Date: Thu, 10 Oct 2024 18:45:24 -0700 Subject: [PATCH 1/4] xfs/122: update for segmented rtblock addresses From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, hch@lst.de, fstests@vger.kernel.org Message-ID: <172860659110.4189705.11393328061722947918.stgit@frogsfrogsfrogs> In-Reply-To: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> References: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Check the offset of sb_rgblklog. Signed-off-by: Darrick J. Wong --- tests/xfs/122.out | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/xfs/122.out b/tests/xfs/122.out index 18aff98f96ac46..3fbc4d4fc49ad1 100644 --- a/tests/xfs/122.out +++ b/tests/xfs/122.out @@ -36,7 +36,8 @@ offsetof(xfs_sb_t, sb_lsn) = 240 offsetof(xfs_sb_t, sb_magicnum) = 0 offsetof(xfs_sb_t, sb_meta_uuid) = 248 offsetof(xfs_sb_t, sb_metadirino) = 264 -offsetof(xfs_sb_t, sb_metadirpad) = 204 +offsetof(xfs_sb_t, sb_metadirpad0) = 205 +offsetof(xfs_sb_t, sb_metadirpad1) = 206 offsetof(xfs_sb_t, sb_pquotino) = 232 offsetof(xfs_sb_t, sb_qflags) = 176 offsetof(xfs_sb_t, sb_rblocks) = 16 @@ -45,7 +46,7 @@ offsetof(xfs_sb_t, sb_rbmino) = 64 offsetof(xfs_sb_t, sb_rextents) = 24 offsetof(xfs_sb_t, sb_rextsize) = 80 offsetof(xfs_sb_t, sb_rextslog) = 125 -offsetof(xfs_sb_t, sb_rgblklog) = 280 +offsetof(xfs_sb_t, sb_rgblklog) = 204 offsetof(xfs_sb_t, sb_rgcount) = 272 offsetof(xfs_sb_t, sb_rgextents) = 276 offsetof(xfs_sb_t, sb_rootino) = 56 From patchwork Fri Oct 11 01:45:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13831937 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02C7910E9; Fri, 11 Oct 2024 01:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611141; cv=none; b=rhO28D5q2KQEfjDap9xbF3X2FF4eGWywaGASNnsSDzSIPAbiutbFF5udTW/oN+iOKL5v2wdW6ys9Jh2arG6ZIUvcKxkzIQngHm2jgSIOBzedy2u1RzwdbhYvHMTZ7z5RN8AEwlWCnlwDpfxMnmF0szsoOYLEYrJbcKBU74L+NUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611141; c=relaxed/simple; bh=DTYKBwEqFZZSw5FMkfwkAKepyF1So9fXMZK7WGG1mWM=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Cp/UlDQOMVqdBalqHoL/Pwfnw4dV0BkGv/OXuaKThSHqquGGOn/MmD5pNpW07CJ9gkrTOETpWsr4lxS+SjivsDvoyjMuWnI8mRP6DrEhCbhz3kVxV2AueydYc0aeNi8TZplju4xunNS4FIT3bsjL++H6TqjnBsAx2ZMKO3J7Hkg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jVU3ENlE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jVU3ENlE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8001AC4CEC5; Fri, 11 Oct 2024 01:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728611140; bh=DTYKBwEqFZZSw5FMkfwkAKepyF1So9fXMZK7WGG1mWM=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=jVU3ENlES64JAcBwgac9tZKdxXCz0qRavts4/eIeItxKGpW+lE23Zieo0qbwQTIiJ H/qYK1J1RqSOp+yA6TRpEkERkIGmZk/sRz5igKx9/USFr+Kph1JbL3bhSfq7/d960j JNujSjCUveD0wUHCYBN0Hbq1xEaDI41xCKa5CVDUUoIf3BN/gyJHeSwWxFg8LwIkDc YVg59tLo14DIhxZ9oKzAHNx2BUwdKSphmz9t+Ia1uA9kZ0FvgGCn9fYgpelx3jOBpy iu/go+MhSbP5yBxAo7MDpmyz4SN6L8B130bPCDIho4O0OMZGH/ErwFRovhUhoGTWBi vgGXwAHDUOgSA== Date: Thu, 10 Oct 2024 18:45:40 -0700 Subject: [PATCH 2/4] xfs: update tests for quota files in the metadir From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, hch@lst.de, fstests@vger.kernel.org Message-ID: <172860659125.4189705.14212623337550950472.stgit@frogsfrogsfrogs> In-Reply-To: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> References: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Update fstests to handle quota files in the metadir. Signed-off-by: Darrick J. Wong --- common/xfs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/xfs b/common/xfs index 6bd411cad67f5f..7198a5579d4cfa 100644 --- a/common/xfs +++ b/common/xfs @@ -1949,6 +1949,24 @@ _scratch_xfs_find_metafile() return 0 fi ;; + "uquotino") + if _xfs_has_feature "$SCRATCH_DEV" metadir; then + echo "path -m /quota/user" + return 0 + fi + ;; + "gquotino") + if _xfs_has_feature "$SCRATCH_DEV" metadir; then + echo "path -m /quota/group" + return 0 + fi + ;; + "pquotino") + if _xfs_has_feature "$SCRATCH_DEV" metadir; then + echo "path -m /quota/project" + return 0 + fi + ;; esac sb_field="$(_scratch_xfs_get_sb_field "$metafile")" From patchwork Fri Oct 11 01:45:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13831938 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 468652107; Fri, 11 Oct 2024 01:45:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611156; cv=none; b=WZKeIvEq3gLELBljOtkBP5qpMaORnvGIu9USW5lT2S75K0HiBH3gOatNEF/Sgk15K7KsHVM67F/Q5hcrIR6vgq4hqNxLysMZJBd31N2oV/oEeKcyLKfC+IuMap+XK33QhmVMqKUJlMrDhd6oZ0NhzromfAHgulHIiwZ/yUIyOhc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611156; c=relaxed/simple; bh=NgT3xqZ4ZSnZWqhIQBDho7i2NrAYNRKpWdnIwlBGQyQ=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sxCfqML4d4ucONB5tcc9cIVD5fGlfCVttF3SglB2BHb4he1gwR4mmUMq6gapcPm58CtBaQZ4vSqbzmLmJHHVk9pw1Uzvvu34VBTH3u0XQnzlS62n46IfrkANVJwLK2zTAMulNnVnCKlj5nP5QlAHgVpJLLaD8mVMtjX/IVtzfFk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ubxx4DxV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ubxx4DxV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F443C4CEC5; Fri, 11 Oct 2024 01:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728611156; bh=NgT3xqZ4ZSnZWqhIQBDho7i2NrAYNRKpWdnIwlBGQyQ=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=ubxx4DxVDbQaZ5mVuGIJmswDkwdlcZeiZ76AMhMfu7Wvg2WwWslhTR6IZxyBYqssL dxehgjZRg2vUZ0gvnpJnUvJP1jbQPg5T/nXQOB64/QPPsyY9+aMEBRR9ZNyfse4MFA QoK9Sas4aofW39g8o4I+5RmKiY/zyYXxMqtr7q/pE/ab6d6pi0n4naIisK+JlCQzYE gvw4pVHpQFu2+ISLGHJRDPrqB7/Aaylxu+XoEL1dXREbLTByAb0oLIZxnJek6aJAeM uvq6dDuEqhhVkvDrFvGf5PSXaLUg0eKHpYE5J73/o2By9lvehja9tk9oeSWZPz+ZRz SNrjZZZ9IeCaA== Date: Thu, 10 Oct 2024 18:45:55 -0700 Subject: [PATCH 3/4] xfs: test persistent quota flags From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, hch@lst.de, fstests@vger.kernel.org Message-ID: <172860659140.4189705.17399104557432681489.stgit@frogsfrogsfrogs> In-Reply-To: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> References: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Test the persistent quota flags that come with the metadir feature. Signed-off-by: Darrick J. Wong --- tests/generic/563 | 8 ++- tests/xfs/1891 | 128 +++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/1891.out | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 282 insertions(+), 1 deletion(-) create mode 100755 tests/xfs/1891 create mode 100644 tests/xfs/1891.out diff --git a/tests/generic/563 b/tests/generic/563 index 0a8129a60ea28f..3f3c335f84b371 100755 --- a/tests/generic/563 +++ b/tests/generic/563 @@ -92,7 +92,13 @@ smajor=$((0x`stat -L -c %t $LOOP_DEV`)) sminor=$((0x`stat -L -c %T $LOOP_DEV`)) _mkfs_dev $LOOP_DEV >> $seqres.full 2>&1 -_mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" +if [ $FSTYP = "xfs" ]; then + # Writes to the quota file are captured in cgroup metrics on XFS, so + # we require that quota is not enabled at all. + _mount $LOOP_DEV -o noquota $SCRATCH_MNT || _fail "mount failed" +else + _mount $LOOP_DEV $SCRATCH_MNT || _fail "mount failed" +fi drop_io_cgroup= grep -q -w io $cgdir/cgroup.subtree_control || drop_io_cgroup=1 diff --git a/tests/xfs/1891 b/tests/xfs/1891 new file mode 100755 index 00000000000000..53009571a95a03 --- /dev/null +++ b/tests/xfs/1891 @@ -0,0 +1,128 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 1891 +# +# Functionality test for persistent quota accounting and enforcement flags in +# XFS when metadata directories are enabled. +# +. ./common/preamble +_begin_fstest auto quick quota + +. ./common/filter +. ./common/quota + +$MKFS_XFS_PROG 2>&1 | grep -q 'uquota' || \ + _notrun "mkfs does not support uquota option" + +_require_scratch +_require_xfs_quota + +filter_quota_state() { + sed -e 's/Inode: #[0-9]\+/Inode #XXX/g' \ + -e '/max warnings:/d' \ + -e '/Blocks grace time:/d' \ + -e '/Inodes grace time:/d' \ + | _filter_scratch +} + +qerase_mkfs_options() { + echo "$MKFS_OPTIONS" | sed \ + -e 's/uquota//g' \ + -e 's/gquota//g' \ + -e 's/pquota//g' \ + -e 's/uqnoenforce//g' \ + -e 's/gqnoenforce//g' \ + -e 's/pqnoenforce//g' \ + -e 's/,,*/,/g' +} + +confirm() { + echo "$MOUNT_OPTIONS" | grep -E -q '(qnoenforce|quota)' && \ + echo "saw quota mount options" + _scratch_mount + $XFS_QUOTA_PROG -x -c "state -ugp" $SCRATCH_MNT | filter_quota_state + _check_xfs_scratch_fs + _scratch_unmount +} + +ORIG_MOUNT_OPTIONS="$MOUNT_OPTIONS" +MKFS_OPTIONS="$(qerase_mkfs_options)" + +echo "Test 0: formatting a subset" +_scratch_mkfs -m uquota,gqnoenforce &>> $seqres.full +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +confirm + +echo "Test 1: formatting" +_scratch_mkfs -m uquota,gquota,pquota &>> $seqres.full +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +confirm + +echo "Test 2: only grpquota" +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option grpquota +confirm + +echo "Test 3: repair" +_scratch_xfs_repair &>> $seqres.full || echo "repair failed?" +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +confirm + +echo "Test 4: weird options" +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option pqnoenforce,uquota +confirm + +echo "Test 5: simple recovery" +_scratch_mkfs -m uquota,gquota,pquota &>> $seqres.full +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +echo "$MOUNT_OPTIONS" | grep -E -q '(qnoenforce|quota)' && \ + echo "saw quota mount options" +_scratch_mount +$XFS_QUOTA_PROG -x -c "state -ugp" $SCRATCH_MNT | filter_quota_state +touch $SCRATCH_MNT/a +_scratch_shutdown -v -f >> $seqres.full +echo shutdown +_scratch_unmount +confirm + +echo "Test 6: simple recovery with mount options" +_scratch_mkfs -m uquota,gquota,pquota &>> $seqres.full +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +echo "$MOUNT_OPTIONS" | grep -E -q '(qnoenforce|quota)' && \ + echo "saw quota mount options" +_scratch_mount +$XFS_QUOTA_PROG -x -c "state -ugp" $SCRATCH_MNT | filter_quota_state +touch $SCRATCH_MNT/a +_scratch_shutdown -v -f >> $seqres.full +echo shutdown +_scratch_unmount +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option gqnoenforce +confirm + +echo "Test 7: user quotaoff recovery" +_scratch_mkfs -m uquota,gquota,pquota &>> $seqres.full +MOUNT_OPTIONS="$ORIG_MOUNT_OPTIONS" +_qmount_option # blank out quota options +echo "$MOUNT_OPTIONS" | grep -E -q '(qnoenforce|quota)' && \ + echo "saw quota mount options" +_scratch_mount +$XFS_QUOTA_PROG -x -c "state -ugp" $SCRATCH_MNT | filter_quota_state +touch $SCRATCH_MNT/a +$XFS_QUOTA_PROG -x -c 'off -u' $SCRATCH_MNT +_scratch_shutdown -v -f >> $seqres.full +echo shutdown +_scratch_unmount +confirm + +# success, all done +status=0 +exit diff --git a/tests/xfs/1891.out b/tests/xfs/1891.out new file mode 100644 index 00000000000000..7e8894088042bb --- /dev/null +++ b/tests/xfs/1891.out @@ -0,0 +1,147 @@ +QA output created by 1891 +Test 0: formatting a subset +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode: N/A +Test 1: formatting +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Test 2: only grpquota +saw quota mount options +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Test 3: repair +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Test 4: weird options +saw quota mount options +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Test 5: simple recovery +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +shutdown +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Test 6: simple recovery with mount options +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +shutdown +saw quota mount options +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Test 7: user quotaoff recovery +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +shutdown +User quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: OFF + Inode #XXX (1 blocks, 1 extents) +Group quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) From patchwork Fri Oct 11 01:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13831939 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29009EAF1; Fri, 11 Oct 2024 01:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611172; cv=none; b=oyCHnMGr7enkxnLmzMh0od0a8JJu4CvvmGKuglc+PG34hmFzajzGBm35em4jA1/Xe98lWwMgmDfmYtI9XFAWGW7xG/nxKlE5v2I+CKikC4yxAmNNwUWc/QkJWVDzkqaTAo1Xt9gvFGMuStmf/23pn5LXaE0ixKuru/+RybDUv0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728611172; c=relaxed/simple; bh=xO4UGfWRua/1rNgdX2yvT093waZdeNDjatoEaDxaD2A=; h=Date:Subject:From:To:Cc:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LuxYYdAk4PUlsisxucjiDyNDvRkPj8jHTJKjxdspJNoGOVY11xb6IvhegFjh9SJIffsHnR1H9twAw2gl5AyWtHNcbcTk0Qz9VR3BTizuRXwBLF6JUlB+SbddS6jsAgrFr1+18NTm3NkZhEiv33kpDtjGTRLZs7cppgzqShDQoVU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EXKmwmtr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EXKmwmtr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF95FC4CEC5; Fri, 11 Oct 2024 01:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728611171; bh=xO4UGfWRua/1rNgdX2yvT093waZdeNDjatoEaDxaD2A=; h=Date:Subject:From:To:Cc:In-Reply-To:References:From; b=EXKmwmtreqMDypkZgX65d4/yRHX/6DXHFrMEDtehigI2QV+xUkM7phr6t/pjhpNII dv0LMIVRRxKCAds8OvErepoS/Cisc7JnHWDGLlm26AtZgv8rDGCEpI2D/8w/cdlocO tYAsXyhTy9vJv/LnBzqFDJMwGAAnQ9SzhIiglLTEcYE6sX943+RIX3EtiJqqaurQTQ hWBxFqQ0X3s2+Rb1bn8zC0UOFJbeqJcyE41HycyoRDrBuortzb+R27Toj0TBEVVLKP 3L+YDN4t0wt8aDHabWWHHXZpeg9wf/qHQ/kDUz/3Cxryvb/FdkzQ6mHG+RMrOUx6i6 LTCh3tM+b14KA== Date: Thu, 10 Oct 2024 18:46:11 -0700 Subject: [PATCH 4/4] xfs: fix tests for persistent qflags From: "Darrick J. Wong" To: zlang@redhat.com, djwong@kernel.org Cc: linux-xfs@vger.kernel.org, hch@lst.de, fstests@vger.kernel.org Message-ID: <172860659156.4189705.3400574246546592573.stgit@frogsfrogsfrogs> In-Reply-To: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> References: <172860659089.4189705.9536461796672270947.stgit@frogsfrogsfrogs> User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Darrick J. Wong Fix the tests that now break with persistent quota flags. Signed-off-by: Darrick J. Wong --- common/quota | 1 + common/rc | 1 + common/xfs | 3 +++ tests/xfs/007 | 2 +- tests/xfs/096 | 1 + tests/xfs/096.out | 2 +- tests/xfs/106 | 2 +- tests/xfs/116 | 13 ++++++++++++- tests/xfs/116.cfg | 1 + tests/xfs/116.out.default | 0 tests/xfs/116.out.metadir | 3 +++ tests/xfs/152 | 2 +- tests/xfs/1856 | 13 +++++++++++++ tests/xfs/263 | 1 + tests/xfs/263.out | 2 +- 15 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 tests/xfs/116.cfg rename tests/xfs/{116.out => 116.out.default} (100%) create mode 100644 tests/xfs/116.out.metadir diff --git a/common/quota b/common/quota index 3bf7d552eecc07..c16634d8d2fbf4 100644 --- a/common/quota +++ b/common/quota @@ -312,6 +312,7 @@ _qmount_option() -e 's/grpjquota=[^, ]*/QUOTA/g' \ -e 's/\bpquota/QUOTA/g' \ -e 's/prjquota/QUOTA/g' \ + -e 's/noquota/QUOTA/g' \ -e 's/quota/QUOTA/g' \ -e 's/uqnoenforce/QUOTA/g' \ -e 's/gqnoenforce/QUOTA/g' \ diff --git a/common/rc b/common/rc index 3171058496c732..1018f0b6afc8e4 100644 --- a/common/rc +++ b/common/rc @@ -3531,6 +3531,7 @@ _get_os_name() _link_out_file_named() { test -n "$seqfull" || _fail "need to set seqfull" + test -r "$seqfull.cfg" || _fail "need $seqfull.cfg" local features=$2 local suffix=$(FEATURES="$features" perl -e ' diff --git a/common/xfs b/common/xfs index 7198a5579d4cfa..c43b824d28f792 100644 --- a/common/xfs +++ b/common/xfs @@ -1689,6 +1689,9 @@ _xfs_filter_mkfs() print STDERR "ldev=\"$1\"\nlbsize=$2\nlblocks=$3\nlversion=$4\n"; print STDOUT "log =LDEV bsize=XXX blocks=XXX\n"; } + if (/^\s+=\s+exchange=(\d+)\s+metadir=(\d+)/) { + print STDERR "exchange=$1\nmetadir=$2\n\n"; + } if (/^\s+=\s+sectsz=(\d+)\s+sunit=(\d+) blks/) { print STDERR "logsectsz=$1\nlogsunit=$2\n\n"; } diff --git a/tests/xfs/007 b/tests/xfs/007 index e35a069f9bd5c5..4721bc832b3fe4 100755 --- a/tests/xfs/007 +++ b/tests/xfs/007 @@ -47,7 +47,7 @@ do_test() # This takes care of newer kernels where quotaoff clears the superblock # quota enforcement flags but doesn't shut down accounting. _scratch_unmount - _qmount_option "" + _qmount_option "noquota" _scratch_mount rm_commands=(-x -c "remove -$off_opts") diff --git a/tests/xfs/096 b/tests/xfs/096 index 57a05a8ffefbd1..f1f5d562d4fa18 100755 --- a/tests/xfs/096 +++ b/tests/xfs/096 @@ -28,6 +28,7 @@ function option_string() if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi; if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi; if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi; + if [ "$VAL" = "0" ]; then OPT=noquota; fi; echo $OPT } diff --git a/tests/xfs/096.out b/tests/xfs/096.out index 1deb7a8c302374..20f68d3870c4a0 100644 --- a/tests/xfs/096.out +++ b/tests/xfs/096.out @@ -1,5 +1,5 @@ QA output created by 096 -== Options: rw == +== Options: noquota == == Options: usrquota,rw == User quota state on SCRATCH_MNT (SCRATCH_DEV) Accounting: ON diff --git a/tests/xfs/106 b/tests/xfs/106 index 066efef1181b8a..10cbd1052bbc89 100755 --- a/tests/xfs/106 +++ b/tests/xfs/106 @@ -155,7 +155,7 @@ test_off() { echo "turning quota off by remounting" _scratch_unmount - _qmount_option "" + _qmount_option "noquota" _qmount } diff --git a/tests/xfs/116 b/tests/xfs/116 index c5e7508f8862ed..3ef6f5ddfdb2d6 100755 --- a/tests/xfs/116 +++ b/tests/xfs/116 @@ -23,7 +23,18 @@ _require_xfs_quota # Only mount with the quota options we specify below _qmount_option "defaults" -_scratch_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs >/dev/null +. $tmp.mkfs +cat $tmp.mkfs >> $seqres.full + +# link correct .out file, see $seqfull.cfg +seqfull=$0 +if [ "$metadir" = 1 ]; then + _link_out_file_named $seqfull.out "metadir" +else + _link_out_file_named $seqfull.out +fi + _scratch_mount "-o uquota" _scratch_unmount _scratch_xfs_db -r -c sb -c print | grep qflags diff --git a/tests/xfs/116.cfg b/tests/xfs/116.cfg new file mode 100644 index 00000000000000..571f542faef97d --- /dev/null +++ b/tests/xfs/116.cfg @@ -0,0 +1 @@ +metadir: metadir diff --git a/tests/xfs/116.out b/tests/xfs/116.out.default similarity index 100% rename from tests/xfs/116.out rename to tests/xfs/116.out.default diff --git a/tests/xfs/116.out.metadir b/tests/xfs/116.out.metadir new file mode 100644 index 00000000000000..3a58fb919b1e39 --- /dev/null +++ b/tests/xfs/116.out.metadir @@ -0,0 +1,3 @@ +QA output created by 116 +qflags = 0x7 +qflags = 0x7 diff --git a/tests/xfs/152 b/tests/xfs/152 index 6c052cbc9b31f5..94428b35d22a87 100755 --- a/tests/xfs/152 +++ b/tests/xfs/152 @@ -194,7 +194,7 @@ test_off() { echo "checking off command (type=$type)" _scratch_unmount - _qmount_option "" + _qmount_option "noquota" _qmount } diff --git a/tests/xfs/1856 b/tests/xfs/1856 index 74f982af65070f..9f43aa32f6f42f 100755 --- a/tests/xfs/1856 +++ b/tests/xfs/1856 @@ -158,6 +158,19 @@ post_exercise() return 0 } +qerase_mkfs_options() { + echo "$MKFS_OPTIONS" | sed \ + -e 's/uquota//g' \ + -e 's/gquota//g' \ + -e 's/pquota//g' \ + -e 's/uqnoenforce//g' \ + -e 's/gqnoenforce//g' \ + -e 's/pqnoenforce//g' \ + -e 's/,,*/,/g' +} + +MKFS_OPTIONS="$(qerase_mkfs_options)" + # Create a list of fs features in the order that support for them was added # to the kernel driver. For each feature upgrade test, we enable all the # features that came before it and none of the ones after, which means we're diff --git a/tests/xfs/263 b/tests/xfs/263 index aedbc4795296d3..83ec8b959fa9de 100755 --- a/tests/xfs/263 +++ b/tests/xfs/263 @@ -27,6 +27,7 @@ function option_string() if [ "$((VAL & 4))" -ne "0" ]; then OPT=prjquota,${OPT}; fi; if [ "$((VAL & 2))" -ne "0" ]; then OPT=grpquota,${OPT}; fi; if [ "$((VAL & 1))" -ne "0" ]; then OPT=usrquota,${OPT}; fi; + if [ "$VAL" = "0" ]; then OPT=noquota; fi; echo $OPT } diff --git a/tests/xfs/263.out b/tests/xfs/263.out index 64c1a5876cfa24..8682eee2680728 100644 --- a/tests/xfs/263.out +++ b/tests/xfs/263.out @@ -1,5 +1,5 @@ QA output created by 263 -== Options: rw == +== Options: noquota == == Options: usrquota,rw == User quota state on SCRATCH_MNT (SCRATCH_DEV) Accounting: ON