From patchwork Mon Jul 26 06:43:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12398545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B42BC4338F for ; Mon, 26 Jul 2021 06:43:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1005F60F11 for ; Mon, 26 Jul 2021 06:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbhGZGC7 (ORCPT ); Mon, 26 Jul 2021 02:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbhGZGC7 (ORCPT ); Mon, 26 Jul 2021 02:02:59 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D81DC061757; Sun, 25 Jul 2021 23:43:28 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id j1so11560826pjv.3; Sun, 25 Jul 2021 23:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1tNhx2SaG2Be9BHEDHoAZ4YhEYgYqL/nZm6wug6AjRs=; b=eDqsI9uf0uSiwD792+GzFge2gmCfuK/ORNp9M3O2YgieakzVHjga3Sm5upIaTqm2ny OTrHNHqIY5/5mMGcGfGjwc+5pQW5ND1X2AIkY+ayl/X5VrByMu+3KHFkrU47m45jokGG Pm7kF3dG8Nfoae45k8ONjmHtXaq9NDv9LJoq9nBmuhEyEJHKCevMMn4d6xBDHIEDo6MS uZtj57NyEafqdfsJiyyIehd/BVKSdYaq6217uHu62GZsb8Sar6ll0q02qIOe86XI8QoG 9h2r8L3zkTBFcN/xyS0GIkAiOExKzh2rB/qAFOzvXuOcnuhKuHkAzVSycPARpMSchDK0 pmmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1tNhx2SaG2Be9BHEDHoAZ4YhEYgYqL/nZm6wug6AjRs=; b=rr7taBkc2u4esth2cC1Y8WY/i3UcJMw1kld7ZTyuRTE2pk8dwXGg04AdCxJE6j2N7D lQdQRzX6KNv1RL79cIpQeLGd+anfYmiat0sYbv9Ii8LQHdqE0oXlaBg1CeHUts9mu+WO XuOryWbzDAuIoEQCSMEHTPPjPkS4c/e1GvI2vIYA43HIYUotqdCGw+xCyPiC/U8iHw2P ZW1qVSYYeLsHrem0c9DTcYD17ccur8g51nNx9sSYQqRJIXTypZldT85YuWdF9v3JWQlO 4TMXgwcIo1POwgPVe7P0X9ET16Q3EhyOdwCCHDg6Zu19zLrLRQn4ARCwVsbZyQIZEccF C6QA== X-Gm-Message-State: AOAM5311Go+GkSLMPilIM6z8QfjW1W87QyBbSS7u0mOZhedpR7six2SK ugETQUt8wda3c3spGtm6obpKO1c/lyY= X-Google-Smtp-Source: ABdhPJzkfDM1cduQxZEIC267ICNnrpBvC6Ra9C4Gqewy5xHieLPyiIEPCkbZCl1+kR6kPIJG+XYKKg== X-Received: by 2002:a65:6110:: with SMTP id z16mr13237883pgu.152.1627281807762; Sun, 25 Jul 2021 23:43:27 -0700 (PDT) Received: from localhost.localdomain ([122.167.58.51]) by smtp.gmail.com with ESMTPSA id c11sm44411172pfp.0.2021.07.25.23.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 23:43:27 -0700 (PDT) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , guaneryu@gmail.com, linux-xfs@vger.kernel.org Subject: [PATCH 1/3] xfs/530: Do not pass block size argument to _scratch_mkfs Date: Mon, 26 Jul 2021 12:13:11 +0530 Message-Id: <20210726064313.19153-1-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org _scratch_do_mkfs constructs a mkfs command line by concatenating the values of 1. $mkfs_cmd 2. $MKFS_OPTIONS 3. $extra_mkfs_options The block size argument passed by xfs/530 to _scratch_mkfs() will cause mkfs.xfs to fail if $MKFS_OPTIONS also has a block size specified. In such a case, _scratch_do_mkfs() will construct and invoke an mkfs command line without including the value of $MKFS_OPTIONS. To prevent such silent failures, this commit removes the block size option that was being explicitly passed to _scratch_mkfs(). Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/530 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/530 b/tests/xfs/530 index 4d168ac5..16dc426c 100755 --- a/tests/xfs/530 +++ b/tests/xfs/530 @@ -60,7 +60,7 @@ echo "Format and mount rt volume" export USE_EXTERNAL=yes export SCRATCH_RTDEV=$rtdev -_scratch_mkfs -d size=$((1024 * 1024 * 1024)) -b size=${dbsize} \ +_scratch_mkfs -d size=$((1024 * 1024 * 1024)) \ -r size=${rtextsz},extsize=${rtextsz} >> $seqres.full _try_scratch_mount || _notrun "Couldn't mount fs with synthetic rt volume" From patchwork Mon Jul 26 06:43:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12398547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AF66C4338F for ; Mon, 26 Jul 2021 06:43:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EAA1960F4A for ; Mon, 26 Jul 2021 06:43:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231616AbhGZGDC (ORCPT ); Mon, 26 Jul 2021 02:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbhGZGDA (ORCPT ); Mon, 26 Jul 2021 02:03:00 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BE6DC061757; Sun, 25 Jul 2021 23:43:30 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id k1so10305210plt.12; Sun, 25 Jul 2021 23:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jUFLFUkCJgFdloUBuT5iV/vcuM8mHTXSbAtDG6b1axo=; b=VppVpLvKkmMfhCVVj3NPTVDElMehfc//chGW5FT4lUgRQyJnFP/oqgvG+aQ/V/oBeq yHcAHbpq8DVLw26cden9Pd497XBpDfSWxiDdf6bx0vufWJ4ujmaRHQ5sxBl/ovRN4NfR sMqWGBLvavnwKLJd5EESXyDVE/Wba+SrDTpnME5oR44gRgsilqHndE6XopMeQf4LyGR/ d/MATogpE4q/oYEXt3fwhZVd2kLWpRlY1KSyZriT0HNnyIb7HMhte7LfCL5KTRYwG2F4 /sfx1nZKcwfA34nYA7Td5WtWRND3c/eF4DYq9NLecjQN880+b9/KfJNX9HiM2SYvnH9M rMrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jUFLFUkCJgFdloUBuT5iV/vcuM8mHTXSbAtDG6b1axo=; b=QPOEwRhRUk65QH4FT79gOSzLw08xTLhFLQyxH0JbcKoR1QFmlMUp0KgARVT84L8HR3 yCKoB8n9Nnfn7lenUS1GCk1igrj/HCPV0harquCjZMDoGMjAVz470q4+P9SBJTRvBOzz GIyUBmbsChcaKsPdZBvUwfau0j9qAsmVLvOh9mgtfVQ4+8FWZZ4YR8EcawPPvGMSHD/i 3vCMAbg4Wk28PkUwxQZV2sAV73cfLKx+Ggone7u0Bgn5aRYTNg2TdFs35pavt3AQEGYD ydUH7nizShRgnfcZbvEcpW40ecRUo6kMOwvSZg7zAvPj8RpDnUNf/0lznt0FUS3VgKQV R2ag== X-Gm-Message-State: AOAM533FVVDnNnz1qvcaBHAl6m6/2HY/Nv0HO54aGceoSHkPsQ3eabAq oI1SjZrPIKsdACS8T9F0nSZHC/gIQh8= X-Google-Smtp-Source: ABdhPJyvbJJd3J8BdmNAD1PANazPJJ2EWITrb2v7s7iX6lW0XoRaXrKQaQawzRt1qrkYCfJlhMxC/g== X-Received: by 2002:a63:d648:: with SMTP id d8mr16675422pgj.280.1627281809593; Sun, 25 Jul 2021 23:43:29 -0700 (PDT) Received: from localhost.localdomain ([122.167.58.51]) by smtp.gmail.com with ESMTPSA id c11sm44411172pfp.0.2021.07.25.23.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 23:43:29 -0700 (PDT) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , guaneryu@gmail.com, linux-xfs@vger.kernel.org Subject: [PATCH 2/3] common/xfs: Add helpers to obtain reflink/rmapbt status of a filesystem Date: Mon, 26 Jul 2021 12:13:12 +0530 Message-Id: <20210726064313.19153-2-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726064313.19153-1-chandanrlinux@gmail.com> References: <20210726064313.19153-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org This commit adds helpers to obtain status of reflink and rmapbt features of a filesystem. The status of these features are obtained by invoking $XFS_INFO_PROG program. Signed-off-by: Chandan Babu R --- common/xfs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/common/xfs b/common/xfs index c5e39427..e9f84b56 100644 --- a/common/xfs +++ b/common/xfs @@ -1099,6 +1099,40 @@ _xfs_mount_agcount() $XFS_INFO_PROG "$1" | grep agcount= | sed -e 's/^.*agcount=\([0-9]*\),.*$/\1/g' } +# Get reflink status of a filesystem +_xfs_is_reflink_enabled() +{ + local status + + $XFS_INFO_PROG "$1" | grep -q reflink >> $seqres.full + [[ $? != 0 ]] && return 1 + + status=$($XFS_INFO_PROG "$1" | grep reflink= | \ + sed -e 's/^.*reflink=\([0-1]\).*$/\1/g') + if [[ $status == 1 ]]; then + return 0 + else + return 1 + fi +} + +# Get rmapbt status of a filesystem +_xfs_is_rmapbt_enabled() +{ + local status + + $XFS_INFO_PROG "$1" | grep -q rmapbt >> $seqres.full + [[ $? != 0 ]] && return 1 + + status=$($XFS_INFO_PROG "$1" | grep rmapbt= | \ + sed -e 's/^.*rmapbt=\([0-1]\).*$/\1/g') + if [[ $status == 1 ]]; then + return 0 + else + return 1 + fi +} + # Wipe the superblock of each XFS AGs _try_wipe_scratch_xfs() { From patchwork Mon Jul 26 06:43:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Babu R X-Patchwork-Id: 12398549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD872C4320A for ; Mon, 26 Jul 2021 06:43:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B34D360F4C for ; Mon, 26 Jul 2021 06:43:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbhGZGDD (ORCPT ); Mon, 26 Jul 2021 02:03:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbhGZGDD (ORCPT ); Mon, 26 Jul 2021 02:03:03 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2020C061757; Sun, 25 Jul 2021 23:43:31 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id m10-20020a17090a34cab0290176b52c60ddso6816651pjf.4; Sun, 25 Jul 2021 23:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/iaCvaLOpkt/lr5zM77dZJdmTi3kdFvmuc5yLBJHjUk=; b=nqhVB/iNIR4tMmbkxvrm3+C+6xLEJo8GxAEXJJCYWuhoBoVetzFtK0T547DWVXX/BD lNFcz/id0wyq//lBh4AoBR8uBXuw/lvVyUaY0rhHrsEUM1tn0n6+MU5sJdR8Gv5J+4eJ gTloSOgAniMIkYhfnpqc8d0s/cMMFYUDkGE6Eta8vjMzPLTUNrSCz1GbLNfpGBHA4SSR mWkc8U3UaHVDoFHKKExOnS2/fQOvWxgdTVjpRqh2VwtvVITXFD5umCjIGy3/STnwpq+A b0bEUMGvsBIkur0V/dOQF4RHLVaH6zH7oqKHrzPSObif2kH+Eop2FVLTc60Va1pktY3q 2hhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/iaCvaLOpkt/lr5zM77dZJdmTi3kdFvmuc5yLBJHjUk=; b=OB0YKJreG/6BLtG6pLygGwUTXsdpdJkAFJj/kw2S9Dft7jJxTuq8ZfiZjPmSiyuOs8 yeR2b+W5iEI1++ra1xP0xEHsEC4p5UwLt0Trb4wNzASU/0sCCLSIKeSb2mt4D3tIHAEn bDRrWEHfwr3yyxOTLli6r1UB60QnLhbF3AnSmDogdvtTXg3oZutS8kh7sbhpxY4XGbhI QP5H88YRspEfpLRIcr6+1e0p52vfdkspxXkvpqaLf1Jh4zfAW65w1y+yCdwPBHe/Jv/b vzGcgMQHFk2YYTzhlNUuEyTfAbEIu1/b5+X/LW9ryksamDmrHzflhMxdG/xVceU6xn1Z YLKw== X-Gm-Message-State: AOAM533rlbAPv5Yn3Q9Yg0rVkaKj2oQqIgSpJ1ViR2ZhC8D4riEo4sqv PEqDTmIY+iRZWgzSz2D5wQvaxlHjGcQ= X-Google-Smtp-Source: ABdhPJxqJjXaznHGLkQOkVaG4NjoE1IVDJZmcJVrPzleQa5sE1qfBcnvi8p63eCV7b8/6MbVZ/vgAA== X-Received: by 2002:a63:1960:: with SMTP id 32mr16915820pgz.86.1627281811333; Sun, 25 Jul 2021 23:43:31 -0700 (PDT) Received: from localhost.localdomain ([122.167.58.51]) by smtp.gmail.com with ESMTPSA id c11sm44411172pfp.0.2021.07.25.23.43.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jul 2021 23:43:31 -0700 (PDT) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , guaneryu@gmail.com, linux-xfs@vger.kernel.org Subject: [PATCH 3/3] xfs/530: Bail out if either of reflink or rmapbt is enabled Date: Mon, 26 Jul 2021 12:13:13 +0530 Message-Id: <20210726064313.19153-3-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726064313.19153-1-chandanrlinux@gmail.com> References: <20210726064313.19153-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org _scratch_do_mkfs constructs a mkfs command line by concatenating the values of 1. $mkfs_cmd 2. $MKFS_OPTIONS 3. $extra_mkfs_options The corresponding mkfs command line fails if $MKFS_OPTIONS enables either reflink or rmapbt feature. The failure occurs because the test tries to create a filesystem with realtime device enabled. In such a case, _scratch_do_mkfs() will construct and invoke an mkfs command line without including the value of $MKFS_OPTIONS. To prevent such silent failures, this commit causes the test to exit if it detects either reflink or rmapbt feature being enabled. Signed-off-by: Chandan Babu R Reviewed-by: Chandan Babu R --- tests/xfs/530 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/xfs/530 b/tests/xfs/530 index 16dc426c..669b061d 100755 --- a/tests/xfs/530 +++ b/tests/xfs/530 @@ -39,6 +39,12 @@ _require_scratch_nocheck echo "* Test extending rt inodes" _scratch_mkfs | _filter_mkfs >> $seqres.full 2> $tmp.mkfs + +_xfs_is_reflink_enabled $SCRATCH_DEV && \ + _notrun "Realtime device cannot be used when reflink feature is enabled" +_xfs_is_rmapbt_enabled $SCRATCH_DEV && \ + _notrun "Realtime device cannot be used when rmapbt feature is enabled" + . $tmp.mkfs echo "Create fake rt volume"