From patchwork Thu Aug 24 16:44:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13364482 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 6985AC6FA8F for ; Thu, 24 Aug 2023 16:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242700AbjHXQpC (ORCPT ); Thu, 24 Aug 2023 12:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242714AbjHXQoh (ORCPT ); Thu, 24 Aug 2023 12:44:37 -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 5EF9B19AD; Thu, 24 Aug 2023 09:44:27 -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 E780467410; Thu, 24 Aug 2023 16:44:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F23B1C433C8; Thu, 24 Aug 2023 16:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692895466; bh=+EGk3NTklNsc2mqEzAy8hcuNClQWSDUYGoK8D+J3qxI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=NU5nWWAVtr4ePAFN93WmpBz5lR9ie6QuqwGUgu4hUi4o0JQPq7am87jWXyI/GDu0o q5UOTiKP9FJaaiViAH2slqzM38fG/cAard9L5O9FfHB1gO33xJlI9oC89x6y6Zakb2 hmyo4r4hzE9PZTtQWa8b+NWLCQQ+uMJlm9ZWG+t6et7n4KQp1RN9fJpl/rV5ZfEVDL aWuNUj9BqYRs+Fm6GTb+bJk4Y4Y+S1G01Db3dciUld7dJnwd560oy1qxD5BlPs47SJ FkQwjUOz5qlcGnfsEMGe6nIk2kNGW/TWdWTxNck7WaoU8IyDsWWmArUZIboroP8qbX 9JeIstUTIUdyA== From: Jeff Layton Date: Thu, 24 Aug 2023 12:44:17 -0400 Subject: [PATCH fstests v2 1/3] common/attr: fix the _require_acl test MIME-Version: 1.0 Message-Id: <20230824-fixes-v2-1-d60c2faf1057@kernel.org> References: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> In-Reply-To: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, 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/ZANAwAIAQAOaEEZVoIVAcsmYgBk54joGY9vv7QFu77TER6OBeiKBvdU71CkoVp3R +TgNv6C/FmJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZOeI6AAKCRAADmhBGVaC FVk2D/kB4JyVPfRLiDWxq7hMNLfU8CeMcIQXEb3sbz2w6Y3bym5FrwWphsOOURs3t+NIkeuFEVX 9b7sR/0hL3Pc7dZALNpXIMKVhzOtYAIavGqR5m3tMIL2hb9qYhdPLlBsliW2EotCGOpXSn6F9Hg LgfRS+aDYX9+eoy2xmuEJUiaWlSCUXPmD5A+5vlOliBADWgvQfhdYl45R1Zrt4zlItj86wZ2D1t L8cO8ccWVRXAwCu2KOUgHeEwvbCtJghJ5xYKGPFfWkpm48bfoMWY90dht+U7tUVOqVew3BIuiVg 1OXNOBrgm4qDBgYUwMd5GMQHEcPmA/YGn7KWJPumOCeTb4Caav+7OtDBcDk9aemWGOfQHA1Rhz8 fHQiiX4Wq5YVHpqGGE+27diVnEU8rP5PC0MpJtLbkfYGco1cW+xAq3qIXO+/eangF7U+c+np/qD emYDQuXv8ovcVZtpV5Mh8dll6LwfuUzvaUjMkEY/rgrsgD64hjWFQOrJtNpVZaGMXx6rTHGAS7L 0bszgw3QSOpSjIkSEpeD508/mwfcsCA+AGDZ1PajL6/8wGIwpuv6AkB1zN+gEpwGfy4QlpX2r9m 3sn8RQ11n+/zp7FIj+rmqmrOW6uQprtJEdXmYXPWYfz7KotGjtD7zKN3LRt+Mf4LD1ht7iXKvKL SDY/6lbLyRSvGCQ== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: fstests@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 --- 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 Thu Aug 24 16:44:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13364485 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 7C549EE49B0 for ; Thu, 24 Aug 2023 16:45:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242704AbjHXQpC (ORCPT ); Thu, 24 Aug 2023 12:45:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242713AbjHXQoh (ORCPT ); Thu, 24 Aug 2023 12:44:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD1881BF1; Thu, 24 Aug 2023 09:44:27 -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 7B9F0673DC; Thu, 24 Aug 2023 16:44:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E003C433C9; Thu, 24 Aug 2023 16:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692895466; bh=HgZga3u8jfJfVDfYAnT9eS86IE3g/cFqBwD3YR8A1jw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=akexVYjV/f30iIixALyoykqsfVumj+pDnYrI6Fd75erChW/tLJndW24CoRKwuG0jN 1zXNZpYViuJETvzNw5dHhTjYPZ7sJFkJgMARGLRS2RK8xvnKHv/p6nm2cshRGo6Evg yW3BjGNAvVK/RJbqLDKH5Sfh90/L1iEkAOdbf8U3zYxZPSMGNKkGV15AwwXNPpiRLS r278UQ9Gj8znTR0mTJAdu6DI/gtRWUhZpcZjbaTH2f+aCv6B31mD0/1JTsvSrHMjRL IcGeqCE+Ifjfdjf1HmKaQEdBnoHl0lKwPTVfcNa76tfQIvBwYnuZ4yk8sOAHRBx/3Q xZsy82dgHL0dw== From: Jeff Layton Date: Thu, 24 Aug 2023 12:44:18 -0400 Subject: [PATCH fstests v2 2/3] generic/513: limit to filesystems that support capabilities MIME-Version: 1.0 Message-Id: <20230824-fixes-v2-2-d60c2faf1057@kernel.org> References: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> In-Reply-To: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1299; i=jlayton@kernel.org; h=from:subject:message-id; bh=HgZga3u8jfJfVDfYAnT9eS86IE3g/cFqBwD3YR8A1jw=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk54jp0vUrBuzaMm1UcUVs6NjZSpgzqQZa/Z5rR j3rOQDFiXKJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZOeI6QAKCRAADmhBGVaC Fb1kD/0aKRi/+lc09u9wrUFPR6G4bpEMMjDGqMgkzpHVvID95IDyvn9WFf1qq8Gw7AvQEJztS5R /O//rR5bgPxphWwzglh4Lrq4HREvotJTPyHmmYyfE+W2WVEBXobck66kYkReL0E72rTuYxAk0oX d2FEd2cN0fG7p7dv4yhYUyvw4h7h0tMSlTHwGIKBYvYd7vG0Al0P2z/lVbcqGzSA7IV7ljNLOty PE2xrxyh6pSjQb0TU7cNF9BUjzBemKi5v0S2BO/dbypm5+TpWIKgVFBI7JIVJKEp//+QkDgehxn mekEjqOrNNuCo4AZlN4sBFTK8M8+Oy/Xb78I3Gvs2kbHKblY8ikzWqsDPt/Zscwhi/XWGqzp4sM smbDVwAgixw7GDy8XpG8rFVaxbmvYW1aJ+kVwRdAdspFdcRJwdcmUxE4BZ5Vd7O8WoECgj8yelb JJ2V08TcX3KVHYPNe7bFPj5f/84MxDIyJrSz/le6qQ9lsN9M4bylFz8kcLFZ/ICp68wEXCL9Ggs wSX1fK8aGa0BOQunLVzC+oM+EkQW7b9nhvaS+DXMtOG97zXKFxZBNfFLpHZt5UJQW0O4chZHin4 fxkWlZkEX5KxluBDobsWzU5nPWPMsrO9MDYRBYaBtnTUXRMcVbu5Yx3iArqlc6sk0q0vUNKD7f1 U2xYSlp5G/VsNaA== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This test requires being able to set file capabilities which some filesystems (namely NFS) do not support. Add a _require_setcap test and only run it on filesystems that pass it. Signed-off-by: Jeff Layton --- common/rc | 13 +++++++++++++ tests/generic/513 | 1 + 2 files changed, 14 insertions(+) diff --git a/common/rc b/common/rc index 5c4429ed0425..33e74d20c28b 100644 --- a/common/rc +++ b/common/rc @@ -5048,6 +5048,19 @@ _require_mknod() rm -f $TEST_DIR/$seq.null } +_require_setcap() +{ + local testfile=$TEST_DIR/setcaptest.$$ + + touch $testfile + $SETCAP_PROG "cap_sys_module=p" $testfile > $testfile.out 2>&1 + if grep -q 'Operation not supported' $testfile.out; then + _notrun "File capabilities are not supported on this filesystem" + fi + + rm -f $testfile $testfile.out +} + _getcap() { $GETCAP_PROG "$@" | _filter_getcap diff --git a/tests/generic/513 b/tests/generic/513 index dc082787ae4e..52f9eb916b4a 100755 --- a/tests/generic/513 +++ b/tests/generic/513 @@ -18,6 +18,7 @@ _supported_fs generic _require_scratch_reflink _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap +_require_setcap _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount From patchwork Thu Aug 24 16:44:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 13364483 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 B6B47C71153 for ; Thu, 24 Aug 2023 16:45:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242696AbjHXQpB (ORCPT ); Thu, 24 Aug 2023 12:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242715AbjHXQoi (ORCPT ); Thu, 24 Aug 2023 12:44:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A0811BF5; Thu, 24 Aug 2023 09:44:28 -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 186FA67416; Thu, 24 Aug 2023 16:44:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A090C433C7; Thu, 24 Aug 2023 16:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692895467; bh=vgCjAo17bP/S+WAkHjSMwOSP8aP1gii4DVtguCfIxhk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=LwQ6ky+wrBhiLrYRhtm16extXmrh0SEWvVUEykXmMSAig9Dy2SNO4U19xSUVP3UF5 fkKZ9GlGycd1oF0bZFXKVSa38tSqzBrDA2Ze7SbpLB0QrF8Gkv9CWMQPt4kiGokCfS rtvInLxK7lZf2bjnKYSYzTGrv4QOKLf76D7D0FXEfsPwgnvW2KIKy+8lfV4beTataJ Zc1KZxVdq+5U1c7J/vPd9IhXN55VEIXq1TUryfaUyCqIX9C919oCw3AdUU9rFYDyZY 6iZHvVTM1yYO1NFiOf3Ol35sy0x3OkGVnUtxwsg2gE0eDGuv/RB8hSsY9fjLmL8HHo g7urIpwbY+WmA== From: Jeff Layton Date: Thu, 24 Aug 2023 12:44:19 -0400 Subject: [PATCH fstests v2 3/3] generic/578: only run on filesystems that support FIEMAP MIME-Version: 1.0 Message-Id: <20230824-fixes-v2-3-d60c2faf1057@kernel.org> References: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> In-Reply-To: <20230824-fixes-v2-0-d60c2faf1057@kernel.org> To: fstests@vger.kernel.org Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Jeff Layton X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1219; i=jlayton@kernel.org; h=from:subject:message-id; bh=vgCjAo17bP/S+WAkHjSMwOSP8aP1gii4DVtguCfIxhk=; b=owEBbQKS/ZANAwAIAQAOaEEZVoIVAcsmYgBk54jp9AVkFjUDxXNs3vBVCjZlacHa7fmhVjLwt XR5Blhwm/eJAjMEAAEIAB0WIQRLwNeyRHGyoYTq9dMADmhBGVaCFQUCZOeI6QAKCRAADmhBGVaC FfRDEACVFab+TNe59DWgztMlDBAXseE2lQE3Xoxl+5Z6L+reaig/yUc4BbHutfXtKGcerv6Z20N P8q2s9Dd8XBnAqjiUjqcdTEywSm/9bAyI280FukauyUtbl7QXwhYHW9pLYtLMzyryIXV6D36qla 0vx6LzI0JC8OoV4cJU9dmOUWEooTTzZM4Y8r5X+Buh6tDifM3N6ggN1vsxqdH5qkTm9tJZP3bKu ukxHgOVIYkRCjiZQRMDHn/ZgbwYNsLSqxDdL5Rmr7qyizIwGXrcrWSPnY6iiW4Mr9rSnCR22XZi twXStNrYI53QSmspCMuTbWbJEYneab82aih9i3ZGQ7p2Z6wvqdL3lx4gY9t4skBR5Xev337vKuO wGi56sPIcIqVx9JKGOXZUp56sFahydftdSIi8fFvzcqvozKM7qs9gtc23JeaX0ezivAiFqctonP f6ik/mnwX86WNrQaCu3r4EfKgb8GVolPi1mku3nH/Wf59lzkk5rabCi8BwxrVLfRCcXjafcs3fs 7LsXkjnjERJU+ocxrN62cznPRMUpYUlsm7GeTc1MspGOmfBGCudwq47cn4i1loC07RroiyMWVmd 2GuYMIg9q2u7/V01R+ak0ZLQAF79/LZ+s7fWPNJ1PEYOQzZlxQrVwwt1CyCRPiB6QsqLr6H0Xvw AvFNhdV6TPO9W0Q== X-Developer-Key: i=jlayton@kernel.org; a=openpgp; fpr=4BC0D7B24471B2A184EAF5D3000E684119568215 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Some filesystems (e.g. NFS) don't support FIEMAP. Limit generic/578 to filesystems that do. Signed-off-by: Jeff Layton --- common/rc | 13 +++++++++++++ tests/generic/578 | 1 + 2 files changed, 14 insertions(+) diff --git a/common/rc b/common/rc index 33e74d20c28b..98d27890f6f7 100644 --- a/common/rc +++ b/common/rc @@ -3885,6 +3885,19 @@ _require_metadata_journaling() fi } +_require_fiemap() +{ + local testfile=$TEST_DIR/fiemaptest.$$ + + touch $testfile + $XFS_IO_PROG -r -c "fiemap" $testfile 1>$testfile.out 2>&1 + if grep -q 'Operation not supported' $testfile.out; then + _notrun "FIEMAP is not supported by this filesystem" + fi + + rm -f $testfile $testfile.out +} + _count_extents() { $XFS_IO_PROG -r -c "fiemap" $1 | tail -n +2 | grep -v hole | wc -l diff --git a/tests/generic/578 b/tests/generic/578 index b024f6ff90b4..903055b2ca58 100755 --- a/tests/generic/578 +++ b/tests/generic/578 @@ -26,6 +26,7 @@ _require_test_program "mmap-write-concurrent" _require_command "$FILEFRAG_PROG" filefrag _require_test_reflink _require_cp_reflink +_require_fiemap compare() { for i in $(seq 1 8); do