From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 EA242847C for ; Thu, 28 Mar 2024 13:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634356; cv=none; b=pHSAC4FM9zZBlxwjVYHcGE7OoXrJKujv9C10bP4pFD71uNS2e+KAWR6sdjuguuuMuLhWmkIwS/y+5WWpaIb46ohG/QTvRW/GkldWi7LYYnDEqHacgyCMfR663HWjogFg4dJgfcF4SZfVyRYqIkP6/D7dYethzng2QNsVLEWyaLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711634356; c=relaxed/simple; bh=FrXhVwIxVzyq0ZgDLaBAuEeuitKdvqnpieGzNRdchsY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KPCnOKxlSIAA34WEPsamZ2txg2uahSsiuH8JxcPKKXu7ACxtzpJO07TXg8DxA8cUKe4RlQetYm6R3dO2n6XBpUYEvGjqDu6SwyTwfiKDgPtDtKyLLHFlMNlPCVo/cvuSclfg+xOMp4ofLm6EPPteYBj2RR4O/MnI+gKcgDncZXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=PJAO1MAW; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PJAO1MAW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711634353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ms2n2zlGo8TxvYk5zuAvnIiwfxjZ7Tedc1VFRaIbiLo=; b=PJAO1MAWXs/woXdxmSDokchqsSt04pcueOo0HL+on6LTEIOoPzMqLDjcmrMRdxday605I0 pUNT2u8MyzGRT1Qf5yaf7E2cVfDK7OBEKzQ9Myr0f66no/mkKru/T5g8/F+0tIejbiKyje jXdGlfnogz527U6Yytq8k13rCSvMa7Q= Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-216-L-BbqL19MwSRep1pRxUrjw-1; Thu, 28 Mar 2024 09:59:12 -0400 X-MC-Unique: L-BbqL19MwSRep1pRxUrjw-1 Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-229ede09748so1124422fac.1 for ; Thu, 28 Mar 2024 06:59:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711634351; x=1712239151; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ms2n2zlGo8TxvYk5zuAvnIiwfxjZ7Tedc1VFRaIbiLo=; b=sJjeyd4Cl2pxmEjB4klflvLiucVpohsJCNlH4JyvbAuMJGPWzdYRJOPDFq4PcMpIch Gm53GWLxeEXZy2VrDbztTHJkrHoUEXN5nKj6K2/43M+xwGZfQWIK9e9QrkGmfmsmEsXs f+5p5Qvn92IJp+waVIS/Aq/NaAgjB3OK013gnjhgQ2i8iFWKrBVQ68/L6aeO58C29igU 2pjMbsMATHOmwX8Bo35Pz9lbV76OEU6MXzPee0PYC45ZqecPgDOrBOvWr0J6DPWT0Q6i 6gVU5403zagqKT9Col1SLiy69xq5Ch1kyv7e8Sjto0F1fN9cv/eJdfanxcFKsSzmiCLR NChQ== X-Forwarded-Encrypted: i=1; AJvYcCXmvzxy5a0WjsuJNWVslB/hzBf1dHBhGTZYCwSG6+25sKvHf9FmZF+4Bn9aSvMJvLir0hftkPARvedqzT7wBoTVrRC0W6FXiQ== X-Gm-Message-State: AOJu0YzaQ1LTnyBh6GorP7bMTihVsRF7mNxPLXzUpVHXxBbVn7Q6NmZa qSnJJqdPnyNk5QBcr5a9sUDMh+WcXInS515htnQ4+jGSf5nwrn9UoVB6GSR0mpu5z9ngbazFI74 35BmBt12Q3yyepWcLdF6nRO6D8XMKaszkg1DeXnLraR4d0Oh7p31mOrieKfL+KxjFng== X-Received: by 2002:a05:6871:7398:b0:21e:6b95:fb2d with SMTP id na24-20020a056871739800b0021e6b95fb2dmr2765105oac.18.1711634351093; Thu, 28 Mar 2024 06:59:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFuKCNVXQDlBgKOT9FwD6UhUOe1IVuWyY7G5vROdusuBrzMlQzfw7uq3JdWI6pJoZZPvspTmg== X-Received: by 2002:a05:6871:7398:b0:21e:6b95:fb2d with SMTP id na24-20020a056871739800b0021e6b95fb2dmr2765069oac.18.1711634350467; Thu, 28 Mar 2024 06:59:10 -0700 (PDT) Received: from dell-per750-06-vm-08.rhts.eng.pek2.redhat.com ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id v17-20020a056a00149100b006e631af9cefsm1386134pfu.62.2024.03.28.06.59.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 06:59:09 -0700 (PDT) Date: Thu, 28 Mar 2024 21:59:05 +0800 From: Zorro Lang To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Subject: Re: [PATCH] xfs: don't run tests that require v4 file systems when not supported Message-ID: <20240328135905.fw27fzpixofpp4v7@dell-per750-06-vm-08.rhts.eng.pek2.redhat.com> References: <20240328121749.15274-1-hch@lst.de> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240328121749.15274-1-hch@lst.de> On Thu, Mar 28, 2024 at 01:17:49PM +0100, Christoph Hellwig wrote: > 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 > --- This change makes sense to me, thanks for this update. By searching "crc=0" in tests/xfs, I got x/096, x/078 and x/300 which are not in this patch. Is there any reason about why they don't need it? Thanks, Zorro > common/xfs | 10 ++++++++++ > tests/xfs/002 | 4 +--- > tests/xfs/045 | 1 + > tests/xfs/095 | 1 + > tests/xfs/132 | 3 ++- > tests/xfs/148 | 2 +- > tests/xfs/158 | 1 + > tests/xfs/160 | 1 + > tests/xfs/194 | 2 ++ > tests/xfs/199 | 1 + > tests/xfs/263 | 1 + > tests/xfs/513 | 1 + > tests/xfs/522 | 1 + > tests/xfs/526 | 1 + > 14 files changed, 25 insertions(+), 5 deletions(-) > > diff --git a/common/xfs b/common/xfs > index 65b509691..5da6987b2 100644 > --- a/common/xfs > +++ b/common/xfs > @@ -1887,3 +1887,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 6c0bb4d04..26d0cd6e4 100755 > --- a/tests/xfs/002 > +++ b/tests/xfs/002 > @@ -23,9 +23,7 @@ _begin_fstest auto quick growfs > _supported_fs xfs > _require_scratch_nocheck > _require_no_large_scratch_dev > - > -# So we can explicitly turn it _off_: > -_require_xfs_mkfs_crc > +_require_xfs_nocrc > > _scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed" > > diff --git a/tests/xfs/045 b/tests/xfs/045 > index d8cc9ac29..69531ba71 100755 > --- a/tests/xfs/045 > +++ b/tests/xfs/045 > @@ -22,6 +22,7 @@ _supported_fs xfs > > _require_test > _require_scratch_nocheck > +_require_xfs_nocrc > > echo "*** get uuid" > uuid=`_get_existing_uuid` > 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/132 b/tests/xfs/132 > index fa36c09c2..1b8de82f5 100755 > --- a/tests/xfs/132 > +++ b/tests/xfs/132 > @@ -19,12 +19,13 @@ _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. > _disable_dmesg_check > > -_require_xfs_mkfs_crc > + > _scratch_mkfs -m crc=0 > $seqres.full 2>&1 > > # The files that EIO in the golden output changes if we have quotas enabled > diff --git a/tests/xfs/148 b/tests/xfs/148 > index 5d0a0bf42..789b8d0a4 100755 > --- a/tests/xfs/148 > +++ b/tests/xfs/148 > @@ -27,7 +27,7 @@ _cleanup() > _supported_fs xfs > _require_test > _require_attrs > -_require_xfs_mkfs_crc > +_require_xfs_nocrc > _disable_dmesg_check > > imgfile=$TEST_DIR/img-$seq > diff --git a/tests/xfs/158 b/tests/xfs/158 > index 4440adf6e..0107fa3d6 100755 > --- a/tests/xfs/158 > +++ b/tests/xfs/158 > @@ -18,6 +18,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 format a filesystem with inobtcount and not finobt. > _scratch_mkfs -m crc=1,inobtcount=1,finobt=0 &> $seqres.full && \ > diff --git a/tests/xfs/160 b/tests/xfs/160 > index 399fe4bcf..134b38a18 100755 > --- a/tests/xfs/160 > +++ b/tests/xfs/160 > @@ -18,6 +18,7 @@ _supported_fs xfs > _require_command "$XFS_ADMIN_PROG" "xfs_admin" > _require_scratch_xfs_bigtime > _require_xfs_repair_upgrade bigtime > +_require_xfs_nocrc > > date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ > _notrun "Userspace does not support dates past 2038." > diff --git a/tests/xfs/194 b/tests/xfs/194 > index 5a1dff5d2..2ef9403bb 100755 > --- a/tests/xfs/194 > +++ b/tests/xfs/194 > @@ -30,6 +30,8 @@ _supported_fs xfs > # real QA test starts here > > _require_scratch > +_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/263 b/tests/xfs/263 > index bce4e13f9..99c97a104 100755 > --- a/tests/xfs/263 > +++ b/tests/xfs/263 > @@ -25,6 +25,7 @@ _require_xfs_quota > # Only test crc and beyond (but we will test with and without the feature) > _require_xfs_mkfs_crc > _require_xfs_crc > +_require_xfs_nocrc > > function option_string() > { > diff --git a/tests/xfs/513 b/tests/xfs/513 > index ce2bb3491..42eceeb90 100755 > --- a/tests/xfs/513 > +++ b/tests/xfs/513 > @@ -37,6 +37,7 @@ _fixed_by_kernel_commit 237d7887ae72 \ > _require_test > _require_loop > _require_xfs_io_command "falloc" > +_require_xfs_nocrc > > LOOP_IMG=$TEST_DIR/$seq.dev > LOOP_SPARE_IMG=$TEST_DIR/$seq.logdev > diff --git a/tests/xfs/522 b/tests/xfs/522 > index 2475d5844..7db3bb9fc 100755 > --- a/tests/xfs/522 > +++ b/tests/xfs/522 > @@ -27,6 +27,7 @@ _supported_fs xfs > _require_test > _require_scratch_nocheck > _require_xfs_mkfs_cfgfile > +_require_xfs_nocrc > > def_cfgfile=$TEST_DIR/a > fsimg=$TEST_DIR/a.img > diff --git a/tests/xfs/526 b/tests/xfs/526 > index 4261e8497..188d0d514 100755 > --- a/tests/xfs/526 > +++ b/tests/xfs/526 > @@ -26,6 +26,7 @@ _supported_fs xfs > _require_test > _require_scratch_nocheck > _require_xfs_mkfs_cfgfile > +_require_xfs_nocrc > > cfgfile=$TEST_DIR/a > rm -rf $cfgfile > -- > 2.39.2 > >