From patchwork Wed Aug 30 10:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13370444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D2DCC83F17 for ; Wed, 30 Aug 2023 18:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbjH3S3X (ORCPT ); Wed, 30 Aug 2023 14:29:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243431AbjH3K7S (ORCPT ); Wed, 30 Aug 2023 06:59:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 088C9CC2; Wed, 30 Aug 2023 03:59:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92BBE627EA; Wed, 30 Aug 2023 10:59:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E576C433C9; Wed, 30 Aug 2023 10:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693393155; bh=+EGk3NTklNsc2mqEzAy8hcuNClQWSDUYGoK8D+J3qxI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HJKkPYl+80xt3cr3ksqLc9vrQLf0AMttch+vwqRR1UXmGCizQ8kRBAdNY1XT5kLu8 /t3aFnH16twgpM1rS/lX/TK6E7tuaRZigY9ffSZ6xn1mviiMeXfvndX1ftgrSLtxZY xaeR+pAki01BEY2NBH3R7jXQvclq1cfeYerzHTORPPb/iwgm5nTVn1qhlnG0BOdA5K QkC+RHdiYLCS/Zk7uB3ztCPP4hnCCrEtiil2HmsASPn1VrOtwRKmi/dgo++0PXtUua VMkrqhiHUivuJAskvyziwKL74esK1K1gqJoKUeh3FEyZnYGlhNSqrGZ/YzUOxzrFL3 igFqVAVV0sw4A== From: Jeff Layton Date: Wed, 30 Aug 2023 06:58:50 -0400 Subject: [PATCH fstests v4 1/3] common/attr: fix the _require_acl test MIME-Version: 1.0 Message-Id: <20230830-fixes-v4-1-88d7b8572aa3@kernel.org> References: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> In-Reply-To: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Darrick Wong , Zorro Lang , Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1618; i=jlayton@kernel.org; h=from:subject:message-id; bh=+EGk3NTklNsc2mqEzAy8hcuNClQWSDUYGoK8D+J3qxI=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk7yEB+KrnLZBnmvDBQ6RkoJULB2rLono8mikw6 J3t/Z8cxaaJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZO8hAQAKCRAADmhBGVaC FcLmD/0Se/EGHVSdAsXx108kCr6W5Dfog5bvWgnxi0875ZhLbwQ9Xl86/YdajGfNUZ1pjUCgjbz AQ1hph5OHQoW4h/fGjMmKPqOSG6ibLzZ6DwnndKE3OWevXAX63E4lMSfmkWQMrijO5p1GpH97Dw rqf2eLIEkvh99ujTPtw1MJSjQw0XDHFDN85GGjSSyMDlucaHx/rVos7CPdhAeIKAnkXt6H148Aa nIKrP7+vlGK3RXpNQ/T1nv9AfbDS4rcG9QDR2p+NpV+iotk5vypydn5Kb+OlY/GEp95/yDIz42U JN7KdmJ4iG5SvmjB8AzZeT8IUwwlmTaP/sg2+aWaK53KotY4c1QRF4pQMGHayKEsxpDX0aRGkIf Nyzlnnt7TK8AWg11vTe5286wbxHQEBxb6o/4Th5Qpki2501w/kf3dQ337hBPUkC0c4V/fx04LH+ OX6+WNT0Op5TU3KMg2coIdEX8x8Snkciu0+bTj60Nih1vuo8Ch6nsakFibFMN322XacW5ZqSUUa aoXcXQn9h96M+q2Oe+wTgXXoqRmk78e2m3CWfVnR+6f9c2br/Kq0DOPycbwEHcDm5H8GKeZMLQ8 Uyx9yq9FPOXGkBerWpg2I80MCK9TYdhi5wXZkjNfArn+gFHqtv2g1nGNbE9Q3JImn6DLxA7OAF5 gKcHogIng2ShkaA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org _require_acl tests whether you're able to fetch the ACL from a file using chacl, and then tests for an -EOPNOTSUPP error return. Unfortunately, filesystems that don't support them (like NFSv4) just return -ENODATA when someone calls getxattr for the POSIX ACL, so the test doesn't work. Fix the test to have chacl set an ACL on the file instead, which should reliably fail on filesystems that don't support them. Signed-off-by: Jeff Layton Reviewed-by: Darrick J. Wong --- common/attr | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/attr b/common/attr index cce4d1b201b2..3ebba682c894 100644 --- a/common/attr +++ b/common/attr @@ -163,13 +163,12 @@ _require_acls() [ -n "$CHACL_PROG" ] || _notrun "chacl command not found" # - # Test if chacl is able to list ACLs on the target filesystems. On really - # old kernels the system calls might not be implemented at all, but the - # more common case is that the tested filesystem simply doesn't support - # ACLs. + # Test if chacl is able to set an ACL on a file. On really old kernels + # the system calls might not be implemented at all, but the more common + # case is that the tested filesystem simply doesn't support ACLs. # touch $TEST_DIR/syscalltest - chacl -l $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1 + chacl 'u::rw-,g::---,o::---' $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1 cat $TEST_DIR/syscalltest.out >> $seqres.full if grep -q 'Function not implemented' $TEST_DIR/syscalltest.out; then From patchwork Wed Aug 30 10:58:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13370445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D371C83F24 for ; Wed, 30 Aug 2023 18:29:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231635AbjH3S3a (ORCPT ); Wed, 30 Aug 2023 14:29:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243432AbjH3K7T (ORCPT ); Wed, 30 Aug 2023 06:59:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDB6A1BF; Wed, 30 Aug 2023 03:59:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5259662775; Wed, 30 Aug 2023 10:59:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40988C433CB; Wed, 30 Aug 2023 10:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693393155; bh=Z+sH4YtcXtJl1iB0CzUJffwIgkuuQjmeTsMDGAxYurQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N1g2gcUuq9SCKE67r/wEzSpkeUshul5yRa/daTiw8trO5ZIhQpA6+qW2rT/ScL0mw JMvDhqLyKHm/3wdxVm3+WI/GZkA52tdFyZLDRINx/FH6wFL1oppRROO0F1IJabBrc9 seMJS5+eDvVldFU2yyvbgpN0H7uVzXXOXL49c/dgyMfmk9GWZKx0LnEWp++3JF26Hj Noh0ylaAM9GF5q19d0Mbxd93EvjCo7YCtCdbbro+AbVsTccSc5PSCTT9HFXBejt2Zl zgxZ2mAnmVKAoHM1sOImW1y93tKhFkii7KnevhVhWrjd3WRZwnZzdUNJa5lAnFM+nx w4aMmmERVZcXg== From: Jeff Layton Date: Wed, 30 Aug 2023 06:58:51 -0400 Subject: [PATCH fstests v4 2/3] generic/578: add a check to ensure that fiemap is supported MIME-Version: 1.0 Message-Id: <20230830-fixes-v4-2-88d7b8572aa3@kernel.org> References: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> In-Reply-To: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Darrick Wong , Zorro Lang , Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=587; i=jlayton@kernel.org; h=from:subject:message-id; bh=Z+sH4YtcXtJl1iB0CzUJffwIgkuuQjmeTsMDGAxYurQ=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk7yEBOTrNXtJs+RBCImWCTfg5thvoJT3fQ4Xa6 cH91dK//AqJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZO8hAQAKCRAADmhBGVaC Feu7D/4gVKPg4qN6wCxRi11dCm67IvUwWAWdLRLyblHVY5ulOfV44p/qOU34JY0guZ0VS4yMlUY 4erLoIhzPKJzM+NKenYNl4p1UCJ3ZpGqMWUE/cqADHal79Q6mBbYgihD2GZxhxpxseOJwV+r7pW ywXBiDpq6J4poRKrPnp4Q/3hSKT+Wfos40VxuQDlojcmvsQ/yX+Wfbyp3n0LdZ4QrxFiI7W90W9 IljRvn9UFBsBgm0/YgbOlXAUemME9oh9Odw1hUt01BhFN2zfYt8SRFlTkQp7j6histjCaPHw/aS 2WYnackx7Iwt+0iYudVauv0p56SL6Z1AXan1bc54Dk0pCN5/AsveFZat2KJHeAZ2qU7fTfXBetc DeBHm3tyaq05o/pAw62Vme1z/NABGA3xQrSO+vZnXvGX9ZNpqJ8Y+1AGa99BFSTrdtcyP6i5DAw 7Ha+veKHAG53cQL4InaNdxUl3bmGkr85zahTcvFSQU8zlTK3y03k7Gq0S0TA/3kd4dAGHEYrKni 6CjE28crji9zwoP7coxzk9Oe+BNgXMbscbnn5giIlRatOhJMDLinKGIo52M9VUfRQNa3XaEvEL6 SwnFQsF8OTO4ezOcLjyjG7hGwAy/1bpkIElcZ35wYWcr7JzQmEbE+JUX4DJrmBod6oR6E63Ng82 DbeHHVokgV402EQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This test requires FIEMAP support. Suggested-by: Zorro Lang Signed-off-by: Jeff Layton --- tests/generic/578 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/generic/578 b/tests/generic/578 index b024f6ff90b4..e8bb97f7b96c 100755 --- a/tests/generic/578 +++ b/tests/generic/578 @@ -24,6 +24,7 @@ _cleanup() _supported_fs generic _require_test_program "mmap-write-concurrent" _require_command "$FILEFRAG_PROG" filefrag +_require_xfs_io_command "fiemap" _require_test_reflink _require_cp_reflink From patchwork Wed Aug 30 10:58:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13370447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8515C83F1E for ; Wed, 30 Aug 2023 18:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbjH3S3g (ORCPT ); Wed, 30 Aug 2023 14:29:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243433AbjH3K7U (ORCPT ); Wed, 30 Aug 2023 06:59:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76C79CC2; Wed, 30 Aug 2023 03:59:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 163C6627B9; Wed, 30 Aug 2023 10:59:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0326BC433C7; Wed, 30 Aug 2023 10:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693393156; bh=6ZcuktGl77PTi6fYDnXDniAnW1Ylz3ZPnE9Co3jY++U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CNzARJtTpBxffDaZFmhviHmHjNj8K8mFlb8UsKvUtfx7OSCKVoZent8tT2dNVISWj 1eHfbrEya9TEEoR2x3wskyGun6SgTuSYu0gVP61djGcrtfod53xiD+VMt2M3LMPsbs WKc4jUXm3hIrsFrOOAA09M+ZeIcPpTD3j/OQH4x4DO6ZaHwU/OdXp7ZiqGhnLXgAcp wyrogB8pcDVuZsmDNpC3vD2nHvvQcMkPjmZ8cs6gvfK93Sd0vFUZZZruqKuxUT4Ph+ 59X4EjUjdwRlNN8qI7pO/3AMxdSNlgG0cdrqN5hVrThnHsBuLw5QaKdcXhuCnhCsuT 7STJGsKkAsC2w== From: Jeff Layton Date: Wed, 30 Aug 2023 06:58:52 -0400 Subject: [PATCH fstests v4 3/3] generic/*: add a check for security attrs MIME-Version: 1.0 Message-Id: <20230830-fixes-v4-3-88d7b8572aa3@kernel.org> References: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> In-Reply-To: <20230830-fixes-v4-0-88d7b8572aa3@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Darrick Wong , Zorro Lang , Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3223; i=jlayton@kernel.org; h=from:subject:message-id; bh=6ZcuktGl77PTi6fYDnXDniAnW1Ylz3ZPnE9Co3jY++U=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk7yEBJq9tUG0ZJ0m5AmrA91Wq5W/JnR3kWb94y ywiFKhNVoSJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZO8hAQAKCRAADmhBGVaC FVFpD/4xsfXdQhOYaKKwEGPDPYpgeJ75GUDwk6C+jVKUnm5Elf63+qNVW5G7C1t33bPwrdH1OUQ 0tj/n+DXykL+4lcgTNcudXOhgxXQ9ieO9EHsTc9MZeCugM67c47MS2D5FvQPIieanaOYfaOsogq 7HVtYgzGcDQIHJEvaBE2iDeZKUH3z5Epq6NvcsJ+m/T6G1k6wzr9iraabN2RyCz1OAfhorYrGQp 1ccSx67+xauA/095Bt3AhJmVWMxhDkr1h0Q2Fa2bIt8AlXG1OuoQTSGQt5yTeL/nC10DtngsXEa DVY4bbirfNsUdMs4TiipM9LvMhPF7TpmGE+QD6h3ELUvG1hTA2ZPVaIC1X0ay2NvxMmdzsEpr0k mDstI2s06VH7wtdoSb3nN/8PXboRlndb+lVLWbiH7/d2ba+Cw1Afbt9SPAYciYW31LTF6csNlJO bzcbUbjqp6BZr8l9d4nUhNs6uDhzsa+8VVgRV1pEhQT5zEXFLT4ZHkU2h+2a2Fxg1W1By4vG2LY MEV8RsHpl6ZlLsCkXuYWRg6SNAVsVVmEnHkMSF6RL9DfLFMOovsBgJoDUwPNRem5T8psCirjvQ+ ZVk6x56FVhvj3Si9cFzAUXundM5JXGyX+jNZc/uBv690lkvGttobJ+36q29rlh12yv4xC2HJRgN YLI5rGveAJa+0Jg== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org There are several generic tests that require "setcap", but don't check whether the underlying fs supports security attrs. Add the appropriate checks. Signed-off-by: Jeff Layton --- tests/generic/270 | 2 ++ tests/generic/513 | 2 ++ tests/generic/675 | 2 ++ tests/generic/688 | 2 ++ tests/generic/727 | 2 ++ 5 files changed, 10 insertions(+) diff --git a/tests/generic/270 b/tests/generic/270 index 8a6a2822b76b..e7329c2f3280 100755 --- a/tests/generic/270 +++ b/tests/generic/270 @@ -13,6 +13,7 @@ _begin_fstest auto quota rw prealloc ioctl enospc stress # Import common functions. . ./common/filter . ./common/quota +. ./common/attr # Disable all sync operations to get higher load FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0" @@ -58,6 +59,7 @@ _require_user _require_scratch _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap +_require_attrs security _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/513 b/tests/generic/513 index dc082787ae4e..7ff845cea35b 100755 --- a/tests/generic/513 +++ b/tests/generic/513 @@ -12,12 +12,14 @@ _begin_fstest auto quick clone # Import common functions. . ./common/filter . ./common/reflink +. ./common/attr # real QA test starts here _supported_fs generic _require_scratch_reflink _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap +_require_attrs security _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/675 b/tests/generic/675 index 189251f20c0d..cc4309e45a04 100755 --- a/tests/generic/675 +++ b/tests/generic/675 @@ -12,6 +12,7 @@ _begin_fstest auto clone quick # Import common functions. . ./common/filter . ./common/reflink +. ./common/attr # real QA test starts here @@ -21,6 +22,7 @@ _require_user _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap _require_scratch_reflink +_require_attrs security _scratch_mkfs >> $seqres.full _scratch_mount diff --git a/tests/generic/688 b/tests/generic/688 index 426286b6c6ce..e2bf12b4457d 100755 --- a/tests/generic/688 +++ b/tests/generic/688 @@ -18,6 +18,7 @@ _cleanup() # Import common functions. . ./common/filter +. ./common/attr # real QA test starts here @@ -29,6 +30,7 @@ _require_command "$SETCAP_PROG" setcap _require_xfs_io_command falloc _require_test _require_congruent_file_oplen $TEST_DIR 65536 +_require_attrs security junk_dir=$TEST_DIR/$seq junk_file=$junk_dir/a diff --git a/tests/generic/727 b/tests/generic/727 index 58a89e3eda70..2cda49eadab3 100755 --- a/tests/generic/727 +++ b/tests/generic/727 @@ -19,6 +19,7 @@ _begin_fstest auto fiexchange swapext quick # Import common functions. . ./common/filter +. ./common/attr # real QA test starts here @@ -30,6 +31,7 @@ _require_command "$SETCAP_PROG" setcap _require_xfs_io_command swapext '-v vfs -a' _require_xfs_io_command startupdate _require_scratch +_require_attrs security _scratch_mkfs >> $seqres.full _scratch_mount