From patchwork Thu Apr 18 07:40:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13634290 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 E6F60495CB; Thu, 18 Apr 2024 07:40:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426055; cv=none; b=Mv8TwW8Eo7Sli6pvS5KZuy6i5dVhEg79wljwk7CSFVZ1uT/Zcdd20S1KmURYMvfZYjK3ZoEXgHFN2P63s+J5KjuCPc/3pWu6N9LYcE8tYY1AQNyL0nlKb0Q0ARtV7STBMG/w3fB6fq7+Gx+8K2iudJFLc05eMWi9cW7iX29Th/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426055; c=relaxed/simple; bh=TGN0DrSoZl4ripjEu+74ZmK0aG9PdreQZuvcUjmjGDo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZUvaR9s1pTClwZa3PSRNDtbZJHi7b+GIqj9rl5e7NibMO5LI1p20Xn5e+/xuYFglMCbNv2sLZocSn+8UwNd3mcB+KsmYqwjntv3LQOZSJI2HHpCYZcZVvOLHOI4lIbh1nxT4ppVVC+9cPiA6nRq8O9jtTkZUkW/Vd/26i6kcrhA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=V2D3n46N; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="V2D3n46N" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=geOoiK/oqKnqOm807Tvmg/i8RfhT7Jye7XVuyWVilGE=; b=V2D3n46NQfoXtd/yLQAIPQ+w1b Zwtmz1ymZ2kk7IcwsrON3OjQKlbohcQWo/E+aeiRa2mOW0+N5T+3oLdJj3RYVa6buplhQP7w0pDoe LOxni5j/AByOtuiGWX9ApDdQfa+7VqKeNE+IYQ5XZb9lD21cU1F69qBOMkz22NTx9DgHlu2+/WUk8 fczNer/S57fmKPLynnYDByEKSiXzvw4c1ZwVP39VeBihVDBBtU79Bq7DmyS3XjhWnOBCnDA0mctzs pdMVCsR7csbJ4/ULRSx6PGQyazVL8+CPNZ1oCFKW3o2M0Orb9/BqqQtW04X18M2zWloODcRYaS7j8 fptFYqaQ==; Received: from 3.95.143.157.bbcs.as8758.net ([157.143.95.3] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMO4-00000001Iiv-3UXH; Thu, 18 Apr 2024 07:40:53 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J . Wong " , linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 1/5] xfs/045: don't force v4 file systems Date: Thu, 18 Apr 2024 09:40:42 +0200 Message-Id: <20240418074046.2326450-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418074046.2326450-1-hch@lst.de> References: <20240418074046.2326450-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html xfs_db can change UUIDs on v5 filesystems now, so we don't need the -mcrc=0 in this test. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/045 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/xfs/045 b/tests/xfs/045 index d8cc9ac29..a596635ec 100755 --- a/tests/xfs/045 +++ b/tests/xfs/045 @@ -26,10 +26,8 @@ _require_scratch_nocheck echo "*** get uuid" uuid=`_get_existing_uuid` -# We can only change the UUID on a v4 filesystem. Revist this when/if UUIDs -# canbe changed on v5 filesystems. echo "*** mkfs" -if ! _scratch_mkfs_xfs -m crc=0 >$tmp.out 2>&1 +if ! _scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "!!! failed to mkfs on $SCRATCH_DEV" From patchwork Thu Apr 18 07:40:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13634291 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7397B7441A; Thu, 18 Apr 2024 07:40:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426059; cv=none; b=pYG0o5QSrKTZf7iBmST9xvhCWk3YKOIptT7Yr5gWPx6wf2W6onxQr3ZVfiz9J9pQA0GAIHuG8UEiFFSj5wVa/9Q4H7L5dEaWwaEum0uEr0Bemm95H5zmVFCQfOciIU1MF1lsiOee0crUQMCb6puPj3w4MZ66r+W0dNarNHVeh4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426059; c=relaxed/simple; bh=oGYRMa7XnWeNt6URGtqXBe7mbRcCRZ7oxuyP2ZrYF2M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P95ey+FissgSeInnhmpTNi+pQqxUGC8hTqCT7OgTd3cUFfzyIFzQNeRuax4uDnc1CzfAyRd/DI0aMRANoHtIrY5BekmZIE4zGxtj8ToEsjZuyGJHHKdMkKR3uUd7nOKdJ1kGyZZLgz/KUvBGtrpbJiIWA/Tp6E7xvprLz8MV60Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=muGVkrcf; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="muGVkrcf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=Unn7I8/74TCrASjJaagLLfWetVOoFCeL3Aa2qolzRHk=; b=muGVkrcf5U4w4I9fzQebEMkdvs /R/Tv9esbt3M1NA9Rhx4/mG+/MovIfQQirJ0NhwiEmIfG2+e/+jFS5SFfbxuSvYDntGnYWnT8lGdh 4SYQfnbTloguXDcCN2z1vrACKoJBpIR10r+LTgN0tuQ/s2+8XPyzZnkh/Wj/4pUAdyckRjwSJMDl9 u+8W6W9beJg1w5lvMTjpDLVArIYHEDHqrlhUA4uSU8ijzSZScXt77ksrJFrqxjHP61lmZULw1VAEU sChTKMLdaDD5B7HuK272Eji8Xs6tX3xG9K/jwZAhuGm1f4/11NmRzzXWxTYjIbG8/Bpbq/GlPYExZ IVzXgSIA==; Received: from 3.95.143.157.bbcs.as8758.net ([157.143.95.3] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMO8-00000001IjN-1d3k; Thu, 18 Apr 2024 07:40:57 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J . Wong " , linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 2/5] xfs/263: split out the v4 test Date: Thu, 18 Apr 2024 09:40:43 +0200 Message-Id: <20240418074046.2326450-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418074046.2326450-1-hch@lst.de> References: <20240418074046.2326450-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Move the v4-specific test into a separate test case so that we can still run the tests on a kernel without v4 support. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/096 | 73 ++++++++++++++++++++++++++++++++++++++++ tests/xfs/096.out | 84 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/263 | 5 --- tests/xfs/263.out | 85 ----------------------------------------------- 4 files changed, 157 insertions(+), 90 deletions(-) create mode 100755 tests/xfs/096 create mode 100644 tests/xfs/096.out diff --git a/tests/xfs/096 b/tests/xfs/096 new file mode 100755 index 000000000..7eff6cb1d --- /dev/null +++ b/tests/xfs/096 @@ -0,0 +1,73 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2016 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test 096 +# +# test xfs_quota state command (XFS v4 version) +# +. ./common/preamble +_begin_fstest auto quick quota + +# Import common functions. +. ./common/filter +. ./common/quota + +# real QA test starts here + +# Modify as appropriate. +_supported_fs xfs + +_require_scratch +_require_xfs_quota + +function option_string() +{ + VAL=$1 + # Treat 3 options as a bit field, prjquota|grpquota|usrquota + OPT="rw" + 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; + echo $OPT +} + +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 +} + +filter_quota_state2() { + sed -e '/User quota state on/d' \ + -e '/ Accounting: /d' \ + -e '/ Enforcement: /d' \ + -e '/ Inode: /d' \ + -e '/Blocks max warnings: /d' \ + -e '/Inodes max warnings: /d' \ + | _filter_scratch +} + +function test_all_state() +{ + for I in `seq 0 7`; do + OPTIONS=`option_string $I` + echo "== Options: $OPTIONS ==" + # Some combinations won't mount on V4 supers (grp + prj) + _qmount_option "$OPTIONS" + _try_scratch_mount &>> $seqres.full || continue + $XFS_QUOTA_PROG -x -c "state -u" $SCRATCH_MNT | filter_quota_state + $XFS_QUOTA_PROG -x -c "state -g" $SCRATCH_MNT | filter_quota_state + $XFS_QUOTA_PROG -x -c "state -p" $SCRATCH_MNT | filter_quota_state + $XFS_QUOTA_PROG -x -c "state -u" $SCRATCH_MNT | filter_quota_state2 + _scratch_unmount + done +} + +_scratch_mkfs_xfs "-m crc=0 -n ftype=0" >> $seqres.full +test_all_state + +status=0 +exit diff --git a/tests/xfs/096.out b/tests/xfs/096.out new file mode 100644 index 000000000..1deb7a8c3 --- /dev/null +++ b/tests/xfs/096.out @@ -0,0 +1,84 @@ +QA output created by 096 +== Options: rw == +== Options: usrquota,rw == +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: N/A +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: OFF + Enforcement: OFF + Inode: N/A +Blocks grace time: [7 days] +Inodes grace time: [7 days] +Realtime Blocks grace time: [7 days] +== Options: grpquota,rw == +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: N/A +Blocks grace time: [7 days] +Inodes grace time: [7 days] +Realtime Blocks grace time: [7 days] +== Options: usrquota,grpquota,rw == +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: OFF + Enforcement: OFF + Inode: N/A +Blocks grace time: [7 days] +Inodes grace time: [7 days] +Realtime Blocks grace time: [7 days] +== Options: prjquota,rw == +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: OFF + Enforcement: OFF + Inode: N/A +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Blocks grace time: [7 days] +Inodes grace time: [7 days] +Realtime Blocks grace time: [7 days] +== Options: usrquota,prjquota,rw == +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: N/A +Project quota state on SCRATCH_MNT (SCRATCH_DEV) + Accounting: ON + Enforcement: ON + Inode #XXX (1 blocks, 1 extents) +Blocks grace time: [7 days] +Inodes grace time: [7 days] +Realtime Blocks grace time: [7 days] +== Options: grpquota,prjquota,rw == +== Options: usrquota,grpquota,prjquota,rw == diff --git a/tests/xfs/263 b/tests/xfs/263 index bd30dab11..54e9355aa 100755 --- a/tests/xfs/263 +++ b/tests/xfs/263 @@ -66,11 +66,6 @@ function test_all_state() done } -echo "==== NO CRC ====" -_scratch_mkfs_xfs "-m crc=0 -n ftype=0" >> $seqres.full -test_all_state - -echo "==== CRC ====" _scratch_mkfs_xfs "-m crc=1" >>$seqres.full test_all_state diff --git a/tests/xfs/263.out b/tests/xfs/263.out index 531d45de5..64c1a5876 100644 --- a/tests/xfs/263.out +++ b/tests/xfs/263.out @@ -1,89 +1,4 @@ QA output created by 263 -==== NO CRC ==== -== Options: rw == -== Options: usrquota,rw == -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: N/A -Project quota state on SCRATCH_MNT (SCRATCH_DEV) - Accounting: OFF - Enforcement: OFF - Inode: N/A -Blocks grace time: [7 days] -Inodes grace time: [7 days] -Realtime Blocks grace time: [7 days] -== Options: grpquota,rw == -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: N/A -Blocks grace time: [7 days] -Inodes grace time: [7 days] -Realtime Blocks grace time: [7 days] -== Options: usrquota,grpquota,rw == -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: OFF - Enforcement: OFF - Inode: N/A -Blocks grace time: [7 days] -Inodes grace time: [7 days] -Realtime Blocks grace time: [7 days] -== Options: prjquota,rw == -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: OFF - Enforcement: OFF - Inode: N/A -Project quota state on SCRATCH_MNT (SCRATCH_DEV) - Accounting: ON - Enforcement: ON - Inode #XXX (1 blocks, 1 extents) -Blocks grace time: [7 days] -Inodes grace time: [7 days] -Realtime Blocks grace time: [7 days] -== Options: usrquota,prjquota,rw == -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: N/A -Project quota state on SCRATCH_MNT (SCRATCH_DEV) - Accounting: ON - Enforcement: ON - Inode #XXX (1 blocks, 1 extents) -Blocks grace time: [7 days] -Inodes grace time: [7 days] -Realtime Blocks grace time: [7 days] -== Options: grpquota,prjquota,rw == -== Options: usrquota,grpquota,prjquota,rw == -==== CRC ==== == Options: rw == == Options: usrquota,rw == User quota state on SCRATCH_MNT (SCRATCH_DEV) From patchwork Thu Apr 18 07:40:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13634292 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D290F495CB; Thu, 18 Apr 2024 07:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426062; cv=none; b=Lh5pA6rKn9leRoepK5UZ0Fdt7SLYnitCTBzw4zZ3Bz+fhgjXx05Y7K4tXU6uGD1GPYDVHprxymHsnDgA+Ou80S/SgVXAV6/137L5jnmzlbTKk2m4b8p3kGdbpBDk+hbSUMWF2TBzCeB5UYdOfkxdKKb4zyWQaB/ZCF9+t1/9C/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426062; c=relaxed/simple; bh=LC0Fmo8wvXyc+XEhE2TEbh47qbLawvD6wauZuqU37+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jmClcULgaUdtORJIhrMpNZL/L9MalBRHYmyTVM75xvAE0/kSH+CjLCV7UNH+Pk0hveTopP3L9ore9JgIAtZc9FO2s53Qp5EPTo5NWM0/fNb2kFaaf3TX135v/AbKuYibQxWjR0hrcZkQHJo1rQUGn112FsFm7Fy+W7udb9x2u9Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=vpwshcbP; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vpwshcbP" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=mVEwGXmBiSH1a7UVx+gUl87Ba45/hjK8qPtyLPBaaMw=; b=vpwshcbPUqCBIdeqkBqg0ZcA/L YfGJFI5itA53T2gsnGAG5qamWx89IMWTvEWkXYEONgcdUptZhDbNhcpq9VTkzhIDSyU9NiZ3Tja/j CuPlfws03K1ipZHgY5rNMGVHkxI1uzs5GRadmntdloZ2oQvXnHrZqg0iL/feRxfdvy6VVD0qRDhYF UoGONgxwOEMR2ZdWZUTF9i6zTGigkoHfVWb80sZj77iQSPVBLH/onjtNC4XLH3dxZ8PBhKOuyZTKv OcaLWgZ0mI+uQyWmlh+QaJPhiJfR9+IdgX1OYmMKXGOkTFtBn4bsAm3/U+BxmoMEGpvm/lybOG1r+ /ReXgS5w==; Received: from 3.95.143.157.bbcs.as8758.net ([157.143.95.3] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMOB-00000001Ik1-3o92; Thu, 18 Apr 2024 07:41:00 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J . Wong " , linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 3/5] xfs/512: split out v4 specific tests Date: Thu, 18 Apr 2024 09:40:44 +0200 Message-Id: <20240418074046.2326450-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418074046.2326450-1-hch@lst.de> References: <20240418074046.2326450-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Split the v4-specific tests into a new xfs/613. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/513 | 13 --- tests/xfs/513.out | 9 --- tests/xfs/613 | 198 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/613.out | 15 ++++ 4 files changed, 213 insertions(+), 22 deletions(-) create mode 100755 tests/xfs/613 create mode 100644 tests/xfs/613.out diff --git a/tests/xfs/513 b/tests/xfs/513 index ce2bb3491..3a85ed429 100755 --- a/tests/xfs/513 +++ b/tests/xfs/513 @@ -193,10 +193,6 @@ do_mkfs -m crc=1 do_test "" pass "attr2" "true" do_test "-o attr2" pass "attr2" "true" do_test "-o noattr2" fail -do_mkfs -m crc=0 -do_test "" pass "attr2" "true" -do_test "-o attr2" pass "attr2" "true" -do_test "-o noattr2" pass "attr2" "false" # Test discard do_mkfs @@ -255,15 +251,6 @@ do_test "-o logbsize=128k" pass "logbsize=128k" "true" do_test "-o logbsize=256k" pass "logbsize=256k" "true" do_test "-o logbsize=8k" fail do_test "-o logbsize=512k" fail -do_mkfs -m crc=0 -l version=1 -# New kernel (refer to 4f62282a3696 xfs: cleanup xlog_get_iclog_buffer_size) -# prints "logbsize=N" in /proc/mounts, but old kernel not. So the default -# 'display' about logbsize can't be expected, disable this test. -#do_test "" pass "logbsize" "false" -do_test "-o logbsize=16384" pass "logbsize=16k" "true" -do_test "-o logbsize=16k" pass "logbsize=16k" "true" -do_test "-o logbsize=32k" pass "logbsize=32k" "true" -do_test "-o logbsize=64k" fail # Test logdev do_mkfs diff --git a/tests/xfs/513.out b/tests/xfs/513.out index eec8155d7..399459071 100644 --- a/tests/xfs/513.out +++ b/tests/xfs/513.out @@ -13,10 +13,6 @@ FORMAT: -m crc=1 TEST: "" "pass" "attr2" "true" TEST: "-o attr2" "pass" "attr2" "true" TEST: "-o noattr2" "fail" -FORMAT: -m crc=0 -TEST: "" "pass" "attr2" "true" -TEST: "-o attr2" "pass" "attr2" "true" -TEST: "-o noattr2" "pass" "attr2" "false" FORMAT: TEST: "" "pass" "discard" "false" TEST: "-o discard" "pass" "discard" "true" @@ -51,11 +47,6 @@ TEST: "-o logbsize=128k" "pass" "logbsize=128k" "true" TEST: "-o logbsize=256k" "pass" "logbsize=256k" "true" TEST: "-o logbsize=8k" "fail" TEST: "-o logbsize=512k" "fail" -FORMAT: -m crc=0 -l version=1 -TEST: "-o logbsize=16384" "pass" "logbsize=16k" "true" -TEST: "-o logbsize=16k" "pass" "logbsize=16k" "true" -TEST: "-o logbsize=32k" "pass" "logbsize=32k" "true" -TEST: "-o logbsize=64k" "fail" FORMAT: TEST: "" "pass" "logdev" "false" TEST: "-o logdev=LOOP_SPARE_DEV" "fail" diff --git a/tests/xfs/613 b/tests/xfs/613 new file mode 100755 index 000000000..522358cb3 --- /dev/null +++ b/tests/xfs/613 @@ -0,0 +1,198 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2019 Red Hat, Inc. All Rights Reserved. +# +# FS QA Test No. 613 +# +# XFS v4 mount options sanity check, refer to 'man 5 xfs'. +# +. ./common/preamble +_begin_fstest auto mount prealloc + +# Override the default cleanup function. +_cleanup() +{ + cd / + rm -f $tmp.* + $UMOUNT_PROG $LOOP_MNT 2>/dev/null + if [ -n "$LOOP_DEV" ];then + _destroy_loop_device $LOOP_DEV 2>/dev/null + fi + if [ -n "$LOOP_SPARE_DEV" ];then + _destroy_loop_device $LOOP_SPARE_DEV 2>/dev/null + fi + rm -f $LOOP_IMG + rm -f $LOOP_SPARE_IMG + rmdir $LOOP_MNT +} + +# Import common functions. +. ./common/filter + +# real QA test starts here +_supported_fs xfs +_fixed_by_kernel_commit 237d7887ae72 \ + "xfs: show the proper user quota options" + +_require_test +_require_loop +_require_xfs_io_command "falloc" + +LOOP_IMG=$TEST_DIR/$seq.dev +LOOP_SPARE_IMG=$TEST_DIR/$seq.logdev +LOOP_MNT=$TEST_DIR/$seq.mnt + +echo "** create loop device" +$XFS_IO_PROG -f -c "truncate 32g" $LOOP_IMG +LOOP_DEV=`_create_loop_device $LOOP_IMG` + +echo "** create loop log device" +$XFS_IO_PROG -f -c "truncate 1g" $LOOP_SPARE_IMG +LOOP_SPARE_DEV=`_create_loop_device $LOOP_SPARE_IMG` + +echo "** create loop mount point" +rmdir $LOOP_MNT 2>/dev/null +mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" + +filter_loop() +{ + sed -e "s,\B$LOOP_MNT,LOOP_MNT,g" \ + -e "s,\B$LOOP_DEV,LOOP_DEV,g" \ + -e "s,\B$LOOP_SPARE_DEV,LOOP_SPARE_DEV,g" +} + +filter_xfs_opt() +{ + sed -e "s,allocsize=$pagesz,allocsize=PAGESIZE,g" +} + +# avoid the effection from MKFS_OPTIONS +MKFS_OPTIONS="" +do_mkfs() +{ + echo "FORMAT: $@" | filter_loop | tee -a $seqres.full + $MKFS_XFS_PROG -f $* $LOOP_DEV | _filter_mkfs >>$seqres.full 2>$tmp.mkfs + if [ "${PIPESTATUS[0]}" -ne 0 ]; then + _fail "Fails on _mkfs_dev $* $LOOP_DEV" + fi + . $tmp.mkfs +} + +is_dev_mounted() +{ + findmnt --source $LOOP_DEV >/dev/null + return $? +} + +get_mount_info() +{ + findmnt --source $LOOP_DEV -o OPTIONS -n +} + +force_unmount() +{ + $UMOUNT_PROG $LOOP_MNT >/dev/null 2>&1 +} + +# _do_test [ ] +_do_test() +{ + local opts="$1" + local mounted="$2" # pass or fail + local key="$3" + local found="$4" # true or false + local rc + local info + + # mount test + _mount $LOOP_DEV $LOOP_MNT $opts 2>>$seqres.full + rc=$? + if [ $rc -eq 0 ];then + if [ "${mounted}" = "fail" ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: expect mount to fail, but it succeeded" + return 1 + fi + is_dev_mounted + if [ $? -ne 0 ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: fs not mounted even mount return 0" + return 1 + fi + else + if [ "${mounted}" = "pass" ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: expect mount to succeed, but it failed" + return 1 + fi + is_dev_mounted + if [ $? -eq 0 ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: fs is mounted even mount return non-zero" + return 1 + fi + fi + + # Skip below checking if "$key" argument isn't specified + if [ -z "$key" ];then + return 0 + fi + # Check the mount options after fs mounted. + info=`get_mount_info` + echo ${info} | grep -q "${key}" + rc=$? + if [ $rc -eq 0 ];then + if [ "$found" != "true" ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: expected to find \"$key\" in mount info \"$info\"" + return 1 + fi + else + if [ "$found" != "false" ];then + echo "[FAILED]: mount $LOOP_DEV $LOOP_MNT $opts" + echo "ERROR: did not expect to find \"$key\" in \"$info\"" + return 1 + fi + fi + + return 0 +} + +do_test() +{ + # Print each argument, include nil ones + echo -n "TEST:" | tee -a $seqres.full + for i in "$@";do + echo -n " \"$i\"" | filter_loop | filter_xfs_opt | tee -a $seqres.full + done + echo | tee -a $seqres.full + + # force unmount before testing + force_unmount + _do_test "$@" + # force unmount after testing + force_unmount +} + +echo "** start xfs mount testing ..." +# Test attr2 +do_mkfs -m crc=0 +do_test "" pass "attr2" "true" +do_test "-o attr2" pass "attr2" "true" +do_test "-o noattr2" pass "attr2" "false" + +# Test logbsize=value. +do_mkfs -m crc=0 -l version=1 +# New kernel (refer to 4f62282a3696 xfs: cleanup xlog_get_iclog_buffer_size) +# prints "logbsize=N" in /proc/mounts, but old kernel not. So the default +# 'display' about logbsize can't be expected, disable this test. +#do_test "" pass "logbsize" "false" +do_test "-o logbsize=16384" pass "logbsize=16k" "true" +do_test "-o logbsize=16k" pass "logbsize=16k" "true" +do_test "-o logbsize=32k" pass "logbsize=32k" "true" +do_test "-o logbsize=64k" fail + +echo "** end of testing" +# success, all done +status=0 +exit diff --git a/tests/xfs/613.out b/tests/xfs/613.out new file mode 100644 index 000000000..1624617ee --- /dev/null +++ b/tests/xfs/613.out @@ -0,0 +1,15 @@ +QA output created by 613 +** create loop device +** create loop log device +** create loop mount point +** start xfs mount testing ... +FORMAT: -m crc=0 +TEST: "" "pass" "attr2" "true" +TEST: "-o attr2" "pass" "attr2" "true" +TEST: "-o noattr2" "pass" "attr2" "false" +FORMAT: -m crc=0 -l version=1 +TEST: "-o logbsize=16384" "pass" "logbsize=16k" "true" +TEST: "-o logbsize=16k" "pass" "logbsize=16k" "true" +TEST: "-o logbsize=32k" "pass" "logbsize=32k" "true" +TEST: "-o logbsize=64k" "fail" +** end of testing From patchwork Thu Apr 18 07:40:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13634293 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 CE0BD6A342; Thu, 18 Apr 2024 07:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426068; cv=none; b=kvNEWam4mh8+Vy9QFc0Bxcgvit58jkXW+AAAROMLA6jtyIpm06lj4+LAo6216IB2Oo2VIoRNvPkE/6LQiFoWciQQZYsUk3B+MbBEFiRl9dEmmU2u4+RaZqNmexMQptGgR3j5ch8vSVoRLT1Cbe0z4j6Mp6CkeQrpik2RutMSSws= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426068; c=relaxed/simple; bh=CToSS6I7amLm3aUdIcGGGg8WCvN7rg7XPN2G4GFgufQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KjuKcNGfbFnAusROqOG34dXnG9EIxt3yFMEeju4/08DUumYqhZpCtMqqdQYaHRmCN4kniqtXSQ+Nkdr6RLC6CENzZZLc5h2pwNgdlxuN+N47wAsyMIL0if2k3Ar09crhBRzXT4Y7c8xVfB1PJHAE991ZzT7wHT3rvA+CLf2+R1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=vGKKfNoL; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="vGKKfNoL" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=h8UtT+bq6dMZ2LljslF41Fz9WxTreNCs14K/ecsAusM=; b=vGKKfNoLi5XU+rt+20p2kIHU6z nLb/6OXHdPXtb+kaiGCvG4ERwNhEa8/Djv6HoBAxIH0GfirRcapjnuRwN4Be5fpquO7zDbbgIITSd 8giEowY2pEYwnCKnfyQYoBRou28WJCuyoMtMdrz+9JKf99SKKS5XalcX5rvFWW1D+o49LuP4+DvtA Sb37U5yqz5B2d+1zhsnzkPIoo/ZMUZDOKXd5FowdheiUDHNS6YT+e/fZfjvHq84R+JXSa5uiLJ62E 7hgLusn8rHCl/PjoEck2/rEgfbmUTuFBtauFMD8J+L+Bp8SlZj500dYEe55WRqvhrJeRDSXV5BZnz /RytaEQQ==; Received: from 3.95.143.157.bbcs.as8758.net ([157.143.95.3] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMOF-00000001Ilm-3kAJ; Thu, 18 Apr 2024 07:41:04 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J . Wong " , linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 4/5] xfs/{158,160}: split out v4 tests Date: Thu, 18 Apr 2024 09:40:45 +0200 Message-Id: <20240418074046.2326450-5-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418074046.2326450-1-hch@lst.de> References: <20240418074046.2326450-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Move the subtests that check we can't upgrade v4 file systems to a separate test. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- tests/xfs/158 | 5 ----- tests/xfs/158.out | 3 --- tests/xfs/160 | 5 ----- tests/xfs/160.out | 3 --- tests/xfs/612 | 32 ++++++++++++++++++++++++++++++++ tests/xfs/612.out | 7 +++++++ 6 files changed, 39 insertions(+), 16 deletions(-) create mode 100755 tests/xfs/612 create mode 100644 tests/xfs/612.out diff --git a/tests/xfs/158 b/tests/xfs/158 index 4440adf6e..9f03eb528 100755 --- a/tests/xfs/158 +++ b/tests/xfs/158 @@ -23,11 +23,6 @@ _require_xfs_repair_upgrade inobtcount _scratch_mkfs -m crc=1,inobtcount=1,finobt=0 &> $seqres.full && \ echo "Should not be able to format with inobtcount but not finobt." -# Make sure we can't upgrade a V4 filesystem -_scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full -_scratch_xfs_admin -O inobtcount=1 2>> $seqres.full -_check_scratch_xfs_features INOBTCNT - # Make sure we can't upgrade a filesystem to inobtcount without finobt. _scratch_mkfs -m crc=1,inobtcount=0,finobt=0 >> $seqres.full _scratch_xfs_admin -O inobtcount=1 2>> $seqres.full diff --git a/tests/xfs/158.out b/tests/xfs/158.out index 5461031a3..3bc043e43 100644 --- a/tests/xfs/158.out +++ b/tests/xfs/158.out @@ -1,8 +1,5 @@ QA output created by 158 Running xfs_repair to upgrade filesystem. -Inode btree count feature only supported on V5 filesystems. -FEATURES: INOBTCNT:NO -Running xfs_repair to upgrade filesystem. Inode btree count feature requires free inode btree. FEATURES: INOBTCNT:NO Fail partway through upgrading diff --git a/tests/xfs/160 b/tests/xfs/160 index 399fe4bcf..d11eaba3c 100755 --- a/tests/xfs/160 +++ b/tests/xfs/160 @@ -22,11 +22,6 @@ _require_xfs_repair_upgrade bigtime date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ _notrun "Userspace does not support dates past 2038." -# Make sure we can't upgrade a V4 filesystem -_scratch_mkfs -m crc=0 >> $seqres.full -_scratch_xfs_admin -O bigtime=1 2>> $seqres.full -_check_scratch_xfs_features BIGTIME - # Make sure we're required to specify a feature status _scratch_mkfs -m crc=1,bigtime=0,inobtcount=0 >> $seqres.full _scratch_xfs_admin -O bigtime 2>> $seqres.full diff --git a/tests/xfs/160.out b/tests/xfs/160.out index 58fdd68da..9a7647f25 100644 --- a/tests/xfs/160.out +++ b/tests/xfs/160.out @@ -1,8 +1,5 @@ QA output created by 160 Running xfs_repair to upgrade filesystem. -Large timestamp feature only supported on V5 filesystems. -FEATURES: BIGTIME:NO -Running xfs_repair to upgrade filesystem. Running xfs_repair to upgrade filesystem. Adding inode btree counts to filesystem. Adding large timestamp support to filesystem. diff --git a/tests/xfs/612 b/tests/xfs/612 new file mode 100755 index 000000000..4ae4d3977 --- /dev/null +++ b/tests/xfs/612 @@ -0,0 +1,32 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2021 Oracle. All Rights Reserved. +# +# FS QA Test No. 612 +# +# Check that we can upgrade v5 only features on a v4 file system + +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. +. ./common/filter + +# real QA test starts here +_supported_fs xfs +_require_scratch_xfs_inobtcount +_require_command "$XFS_ADMIN_PROG" "xfs_admin" +_require_xfs_repair_upgrade inobtcount + +# Make sure we can't upgrade to inobt on a V4 filesystem +_scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full +_scratch_xfs_admin -O inobtcount=1 2>> $seqres.full +_check_scratch_xfs_features INOBTCNT + +# Make sure we can't upgrade to bigtim on a V4 filesystem +_scratch_mkfs -m crc=0 >> $seqres.full +_scratch_xfs_admin -O bigtime=1 2>> $seqres.full +_check_scratch_xfs_features BIGTIME + +status=0 +exit diff --git a/tests/xfs/612.out b/tests/xfs/612.out new file mode 100644 index 000000000..6908c15f8 --- /dev/null +++ b/tests/xfs/612.out @@ -0,0 +1,7 @@ +QA output created by 612 +Running xfs_repair to upgrade filesystem. +Inode btree count feature only supported on V5 filesystems. +FEATURES: INOBTCNT:NO +Running xfs_repair to upgrade filesystem. +Large timestamp feature only supported on V5 filesystems. +FEATURES: BIGTIME:NO From patchwork Thu Apr 18 07:40:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13634294 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5E10A70CAA; Thu, 18 Apr 2024 07:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426069; cv=none; b=U27IOzoqMTpvx9RDGLj61Dd4iQj3syG+9VbmQfbwGsrmm1ZuNHLnk/sr66ocQJem79ADlWI6MfeDwk7v2lwiM61Dg6p8abtpRpXpLSGgnM8moOqbjbxiA5AY/pcSA7FUx6tZsGoOGqSlvou7NqoPfNIAQsFp3yMLyxCubHAV8L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713426069; c=relaxed/simple; bh=bGIQsHoiORvPOi7ZtVT7+8tcgKpbWaAQH8lYxD6klOk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=d9JtN4upUE4FyYYU1QocrtnW7PLZYgQWJvEuiSIPFFC1+iZ5DtoxMp7Ep5YE3cfT2MsB3rjM3b2YnClKE67Xqt7IX69Xg6buqPV2zLX1Cg0wL4we4tLXrkgE2r9m0qBFZTOYcsVaKp4d2GOGlG5hUtmD67RpK27PIRLHnARqEFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=0gMHlR4O; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="0gMHlR4O" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=PHPH+2rTlZBkcWWeNUkBkhR3vyx2Mh301mRl5dtiPEc=; b=0gMHlR4OVG2OCu4hK5pJBNyBiy c4vU3/YkbR47ztkAXum1urU//w9a6JCNlZnhKtb5JWqjdWmxAJcwrzRc85bjl0kFjo4CyEqZ8zUsD +cRUU6/FXqkKoLTAjAPNgSphL4ysNKjcDNaaz1tvAwz4vFurWcLg572z2DvvHut7ZYyvEqSz4vqBs vgPS36PTp9R6Bsy5x1xsS5nBIjf6H6NHKr4eGbdxy/bc7suErHG/evyaSIOtw8Yn48RerKwK6EhNe ZCGFGB0JzJ1NBja0bwYFg5As+tQ/kyFLaqyLO0pOrSRjDSk0rRB09zegUzl4RUQCapJpUHYAwlK1k PbK+/BIA==; Received: from 3.95.143.157.bbcs.as8758.net ([157.143.95.3] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rxMOJ-00000001Imp-2RKe; Thu, 18 Apr 2024 07:41:07 +0000 From: Christoph Hellwig To: Zorro Lang Cc: "Darrick J . Wong " , linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: [PATCH 5/5] xfs: don't run tests that require v4 file systems when not supported Date: Thu, 18 Apr 2024 09:40:46 +0200 Message-Id: <20240418074046.2326450-6-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240418074046.2326450-1-hch@lst.de> References: <20240418074046.2326450-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Add a _require_xfs_nocrc helper that checks that we can mkfs and mount a crc=0 file systems before running tests that rely on it to avoid failures on kernels with CONFIG_XFS_SUPPORT_V4 disabled. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- common/xfs | 10 ++++++++++ tests/xfs/002 | 1 + tests/xfs/095 | 1 + tests/xfs/096 | 1 + tests/xfs/132 | 1 + tests/xfs/148 | 6 ++++++ tests/xfs/194 | 10 ++++++++++ tests/xfs/199 | 1 + tests/xfs/300 | 1 + tests/xfs/526 | 3 +++ tests/xfs/612 | 1 + tests/xfs/613 | 1 + 12 files changed, 37 insertions(+) diff --git a/common/xfs b/common/xfs index 49ca5a2d5..733c3a5be 100644 --- a/common/xfs +++ b/common/xfs @@ -1852,3 +1852,13 @@ _xfs_discard_max_offset_kb() $XFS_IO_PROG -c 'statfs' "$1" | \ awk '{g[$1] = $3} END {print (g["geom.bsize"] * g["geom.datablocks"] / 1024)}' } + +# check if mkfs and the kernel support nocrc (v4) file systems +_require_xfs_nocrc() +{ + _scratch_mkfs_xfs -m crc=0 > /dev/null 2>&1 || \ + _notrun "v4 file systems not supported" + _try_scratch_mount > /dev/null 2>&1 || \ + _notrun "v4 file systems not supported" + _scratch_unmount +} diff --git a/tests/xfs/002 b/tests/xfs/002 index 8dfd2693b..26d0cd6e4 100755 --- a/tests/xfs/002 +++ b/tests/xfs/002 @@ -23,6 +23,7 @@ _begin_fstest auto quick growfs _supported_fs xfs _require_scratch_nocheck _require_no_large_scratch_dev +_require_xfs_nocrc _scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed" diff --git a/tests/xfs/095 b/tests/xfs/095 index a3891c85e..e7dc3e9f4 100755 --- a/tests/xfs/095 +++ b/tests/xfs/095 @@ -19,6 +19,7 @@ _begin_fstest log v2log auto _supported_fs xfs _require_scratch _require_v2log +_require_xfs_nocrc if [ "$(blockdev --getss $SCRATCH_DEV)" != "512" ]; then _notrun "need 512b sector size" diff --git a/tests/xfs/096 b/tests/xfs/096 index 7eff6cb1d..0a1bfb3fa 100755 --- a/tests/xfs/096 +++ b/tests/xfs/096 @@ -20,6 +20,7 @@ _supported_fs xfs _require_scratch _require_xfs_quota +_require_xfs_nocrc function option_string() { diff --git a/tests/xfs/132 b/tests/xfs/132 index ee1c8c1ec..b46d3d28c 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -19,6 +19,7 @@ _supported_fs xfs # we intentionally corrupt the filesystem, so don't check it after the test _require_scratch_nocheck +_require_xfs_nocrc # on success, we'll get a shutdown filesystem with a really noisy log message # due to transaction cancellation. Hence we don't want to check dmesg here. diff --git a/tests/xfs/148 b/tests/xfs/148 index c9f634cfd..fde3bf476 100755 --- a/tests/xfs/148 +++ b/tests/xfs/148 @@ -27,6 +27,8 @@ _cleanup() _supported_fs xfs _require_test _require_attrs +_require_xfs_nocrc + _disable_dmesg_check imgfile=$TEST_DIR/img-$seq @@ -40,6 +42,10 @@ test_names=("something" "$nullstr" "$slashstr" "another") rm -f $imgfile $imgfile.old # Format image file w/o crcs so we can sed the image file +# +# TODO: It might be possible to rewrite this using proper xfs_db +# fs manipulation commands that would work with CRCs. +# # We need to use 512 byte inodes to ensure the attr forks remain in short form # even when security xattrs are present so we are always doing name matches on # lookup and not name hash compares as leaf/node forms will do. diff --git a/tests/xfs/194 b/tests/xfs/194 index 5a1dff5d2..2fcc55b3e 100755 --- a/tests/xfs/194 +++ b/tests/xfs/194 @@ -30,6 +30,16 @@ _supported_fs xfs # real QA test starts here _require_scratch + +# +# This currently forces nocrc because only that can support 512 byte block size +# and thus block size = 1/8 page size on 4k page size systems. +# In theory we could run it on systems with larger page size with CRCs, or hope +# that large folios would trigger the same issue. +# But for now that is left as an exercise for the reader. +# +_require_xfs_nocrc + _scratch_mkfs_xfs >/dev/null 2>&1 # For this test we use block size = 1/8 page size diff --git a/tests/xfs/199 b/tests/xfs/199 index 4669f2c3e..f99b04db3 100755 --- a/tests/xfs/199 +++ b/tests/xfs/199 @@ -26,6 +26,7 @@ _cleanup() _supported_fs xfs _require_scratch +_require_xfs_nocrc # clear any mkfs options so that we can directly specify the options we need to # be able to test the features bitmask behaviour correctly. diff --git a/tests/xfs/300 b/tests/xfs/300 index 2ee5eee71..bc1f0efc6 100755 --- a/tests/xfs/300 +++ b/tests/xfs/300 @@ -13,6 +13,7 @@ _begin_fstest auto fsr . ./common/filter _require_scratch +_require_xfs_nocrc # real QA test starts here diff --git a/tests/xfs/526 b/tests/xfs/526 index 4261e8497..c5c5f9b1a 100755 --- a/tests/xfs/526 +++ b/tests/xfs/526 @@ -27,6 +27,9 @@ _require_test _require_scratch_nocheck _require_xfs_mkfs_cfgfile +# Currently the only conflicting options are v4 specific +_require_xfs_nocrc + cfgfile=$TEST_DIR/a rm -rf $cfgfile diff --git a/tests/xfs/612 b/tests/xfs/612 index 4ae4d3977..0f6df7deb 100755 --- a/tests/xfs/612 +++ b/tests/xfs/612 @@ -17,6 +17,7 @@ _supported_fs xfs _require_scratch_xfs_inobtcount _require_command "$XFS_ADMIN_PROG" "xfs_admin" _require_xfs_repair_upgrade inobtcount +_require_xfs_nocrc # Make sure we can't upgrade to inobt on a V4 filesystem _scratch_mkfs -m crc=0,inobtcount=0,finobt=0 >> $seqres.full diff --git a/tests/xfs/613 b/tests/xfs/613 index 522358cb3..8bff21711 100755 --- a/tests/xfs/613 +++ b/tests/xfs/613 @@ -34,6 +34,7 @@ _supported_fs xfs _fixed_by_kernel_commit 237d7887ae72 \ "xfs: show the proper user quota options" +_require_xfs_nocrc _require_test _require_loop _require_xfs_io_command "falloc"