From patchwork Thu Mar 25 14:08:52 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: 12164185 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.8 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=unavailable 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 428FAC433E0 for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED1DD61A2D for ; Thu, 25 Mar 2021 14:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231322AbhCYOJn (ORCPT ); Thu, 25 Mar 2021 10:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231375AbhCYOJP (ORCPT ); Thu, 25 Mar 2021 10:09:15 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41D7DC06174A; Thu, 25 Mar 2021 07:09:15 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id k23-20020a17090a5917b02901043e35ad4aso2764514pji.3; Thu, 25 Mar 2021 07:09:15 -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=eaB90L146PD7SZTq3L/Wa2Uewelu5u0Gwdi2oCaULaA=; b=O9k7vYv8c7NJnq0aY5xMAjUplsbabbMkbhF+Gs4kUIUMFywMn4N76kmNfOCl+bJZYD 19Ujl20IVKO46sLL8453B44wS3Knbkq+J/sxbpLsJ6A6cjOgHB/W1janMFIMdb8vnbQE EAaCoztlt83cAdHYOdV90kPerzrSzTxPgHa6+wAI92CGSIfgTW44dubS0TKu9fJNQeuy UY+y7jGxTNHxblitLFIgXLvHXb60lBgRXXeVKk+mJYqAbVFhY4PtecJuZ1x3DmLqJCBW MX71paKFI2qqoysgLNUtBMPPDEYrXun6+mn/T8i2qkS34dLaGFF+Um3veRJvQMjYXJEV bMFg== 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=eaB90L146PD7SZTq3L/Wa2Uewelu5u0Gwdi2oCaULaA=; b=Pt6yuXlSP9en3rLAyi0wLH3/j5O4loUdppNGAL/qMg2G4zwPhwD7lud2hxrgWrdvfm 0gX9tUeFx6TI6m5thpxNx/n0jS6fiCzjT4Up2CLpCfsv2wCTHtpcQe0lWXxNA2wfLOmm 7R8qd1FeOkg5+nrlfQQtwEtpCnxGhMN+jaYbJQzsrbpNdbyWrLUH7DjR50X9f03GaZS4 0bYbSd3XOOzpCPUSYAmaAhk2gWvVhCnpXl7yyOYnv8xB9z1ltdB4J8J3Dv/SCv34MJMq lRg/iXP4ogmoEqh1pRsLPiOZn7rsBhUluCMjGVdOwJgiKRldyKgymmWdJIf8lSo2RC42 KaTw== X-Gm-Message-State: AOAM530SvGAIAU9ByEqsbZtNg4hZk1EpvRHB1HfBFs2GzKIpS3dN8qJH Fq0+74sJejIrykPoUFJ33RiwOeK9r5o= X-Google-Smtp-Source: ABdhPJw9ns9gKRaelxJMsBX5LSM5svuHRGN2CZMRUhc4J/k2b5xIT7h0we2kxXVPdRA/GUMjy0LUxQ== X-Received: by 2002:a17:90a:c096:: with SMTP id o22mr9089149pjs.119.1616681354646; Thu, 25 Mar 2021 07:09:14 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:14 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R Subject: [PATCH 1/6] xfs/529: Execute chown on an existing directory entry Date: Thu, 25 Mar 2021 19:38:52 +0530 Message-Id: <20210325140857.7145-1-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org chown command is being executed on $testfile which is actually deleted just before the execution of quota inode extent count overflow test. Hence the test was not getting exercised at all. This commit fixes the bug by using $fillerdir as the target of chown command. Signed-off-by: Chandan Babu R --- tests/xfs/529 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/xfs/529 b/tests/xfs/529 index 778f6142..abe5b1e0 100755 --- a/tests/xfs/529 +++ b/tests/xfs/529 @@ -150,7 +150,7 @@ nr_quotas=$((nr_quotas_per_block * nr_blks)) echo "Extend uquota file" for i in $(seq 0 $nr_quotas_per_block $nr_quotas); do - chown $i $testfile >> $seqres.full 2>&1 + chown $i $fillerdir >> $seqres.full 2>&1 [[ $? != 0 ]] && break done From patchwork Thu Mar 25 14:08:53 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: 12164187 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.8 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=unavailable 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 ABCB6C433E6 for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 853ED61A2E for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231391AbhCYOJn (ORCPT ); Thu, 25 Mar 2021 10:09:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231383AbhCYOJR (ORCPT ); Thu, 25 Mar 2021 10:09:17 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E194C06174A; Thu, 25 Mar 2021 07:09:17 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id x7-20020a17090a2b07b02900c0ea793940so2768435pjc.2; Thu, 25 Mar 2021 07:09:17 -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=iabgT9xxtg44P7FtEYxw1iFtMX3+KsnLU+bhmLAJjfE=; b=kFZcaqp0HAUp7v+PvOF1uGUnCGg40+z2DXw5WG4ge6QE+Tl2OyYY5KhcCA0u1BmjlG q004TWXAHw6mprlqMBPnwA12Oj1WVxtJ4gM8a4A0W6xn3231AAgNIR2TypHGd9vKucgx FOLPanifDZ1HzsD1VC67Y1568/7FoofHAJZ66cxxdLqyB9jZKw4Xso9U7s2WBv5UfwGw xOIAMixesqJZMgS6ZD6Pumon9SUqgc6JntMlRrCXTaTBoMDLGhxtB+YnAIJL7UqZTkv3 pq+f/HSwBRCWmzJS8/IWua7hz9hc7izE9A3Ub77Z+SFhNizkTvlgc/vZlmnTj0TMrxzM xzJQ== 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=iabgT9xxtg44P7FtEYxw1iFtMX3+KsnLU+bhmLAJjfE=; b=fZIWs18HoRGTGeKzBAnH739thkV//OSD9S4yvvjfsqAEeusBZ8BKiyMdjiN0JgOoaT tveSQVIGnplzDnuPq9sYuPGyrdOvRWHpq85sJoBUtJnyUI/pt7fMM6WDbx3rZCQHgPx9 A8nfB6Ic4gQ5byROlWJJOgTRp9A5jsiFh+HXuxULj9frtLFPFdnx/eZpjXj7TqxA6KDK M9yFxxWLVeoOX+ib2jyOaNKCOqobCrQpcWpT2IO641WEijsUJVt0Dl4LdF7Ax3ybQhDr K2sdhoPwYR14xicIMxMY94aWU2qdHEk/76n4QsgzIq8Af5PDTpx5uVe0/Y/HUyePAIc5 WfvQ== X-Gm-Message-State: AOAM531WBUhBcdB2kqwBbB/5mpxBATGOc/H5L2K/LdnzB1xeNEJH1oJg K3aQchWflOaJwMeGkSkNk7YVN5L3zPY= X-Google-Smtp-Source: ABdhPJzlvVDLatkTCQzBEu12X9xLCz/o0KezPq/TW2jgOR83bOHWKTYM5ucHp1BbJqjHaISXHrGrNw== X-Received: by 2002:a17:90a:5d14:: with SMTP id s20mr9037480pji.6.1616681356517; Thu, 25 Mar 2021 07:09:16 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:16 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R , "Darrick J . Wong" Subject: [PATCH 2/6] xfs/529: Fix test to execute in multi-block directory config Date: Thu, 25 Mar 2021 19:38:53 +0530 Message-Id: <20210325140857.7145-2-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210325140857.7145-1-chandanrlinux@gmail.com> References: <20210325140857.7145-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs/529 attempts to create $testfile after reduce_max_iextents error tag is injected. Creation of $testfile fails when using a multi-block directory test configuration because, 1. A directory can have a pseudo maximum extent count of 10. 2. In the worst case a directory entry creation operation can consume (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block) extents. With 1k fs block size and 4k directory block size, this evaluates to, (5 + 1 + 1) * 4 = 7 * 4 = 28 > 10 (Pseudo maximum inode extent count). This commit fixes the issue by creating $testfile before injecting reduce_max_iextents error tag. Reported-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/529 | 24 +++++++++++++++++++++--- tests/xfs/529.out | 6 +++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/tests/xfs/529 b/tests/xfs/529 index abe5b1e0..b4533eba 100755 --- a/tests/xfs/529 +++ b/tests/xfs/529 @@ -54,6 +54,8 @@ echo "* Delalloc to written extent conversion" testfile=$SCRATCH_MNT/testfile +touch $testfile + echo "Inject reduce_max_iextents error tag" _scratch_inject_error reduce_max_iextents 1 @@ -74,10 +76,18 @@ if (( $nextents > 10 )); then exit 1 fi +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + rm $testfile echo "* Fallocate unwritten extents" +touch $testfile + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + echo "Fallocate fragmented file" for i in $(seq 0 2 $((nr_blks - 1))); do $XFS_IO_PROG -f -c "falloc $((i * bsize)) $bsize" $testfile \ @@ -93,10 +103,18 @@ if (( $nextents > 10 )); then exit 1 fi +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + rm $testfile echo "* Directio write" +touch $testfile + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + echo "Create fragmented file via directio writes" for i in $(seq 0 2 $((nr_blks - 1))); do $XFS_IO_PROG -d -s -f -c "pwrite $((i * bsize)) $bsize" $testfile \ @@ -112,15 +130,15 @@ if (( $nextents > 10 )); then exit 1 fi +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + rm $testfile # Check if XFS gracefully returns with an error code when we try to increase # extent count of user quota inode beyond the pseudo max extent count limit. echo "* Extend quota inodes" -echo "Disable reduce_max_iextents error tag" -_scratch_inject_error reduce_max_iextents 0 - echo "Consume free space" fillerdir=$SCRATCH_MNT/fillerdir nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) diff --git a/tests/xfs/529.out b/tests/xfs/529.out index b2ae3f42..13489d34 100644 --- a/tests/xfs/529.out +++ b/tests/xfs/529.out @@ -4,14 +4,18 @@ Format and mount fs Inject reduce_max_iextents error tag Create fragmented file Verify $testfile's extent count +Disable reduce_max_iextents error tag * Fallocate unwritten extents +Inject reduce_max_iextents error tag Fallocate fragmented file Verify $testfile's extent count +Disable reduce_max_iextents error tag * Directio write +Inject reduce_max_iextents error tag Create fragmented file via directio writes Verify $testfile's extent count -* Extend quota inodes Disable reduce_max_iextents error tag +* Extend quota inodes Consume free space Create fragmented filesystem Inject reduce_max_iextents error tag From patchwork Thu Mar 25 14:08:54 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: 12164189 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.8 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=unavailable 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 89A99C433E4 for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5449C61A2D for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231383AbhCYOJo (ORCPT ); Thu, 25 Mar 2021 10:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230115AbhCYOJT (ORCPT ); Thu, 25 Mar 2021 10:09:19 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195EBC06174A; Thu, 25 Mar 2021 07:09:19 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id 11so2178535pfn.9; Thu, 25 Mar 2021 07:09:19 -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=qKJAfoZxW6CcEJ4e8a+jIHh3UfMmaPIJTJRP9/d5eic=; b=pJO5dT3WSyvj3zUMGP5OhTIUIS3sTVLW0t9EkrgNqmbP3Td4OweuQEB8QwsU3RuGtJ kbLo0fmn42rL+Y1aetqLrD8kTHeFQiQZSQYNmVS+9j8c4Ljkz8E9t6F8a9JGV0Y3lArs du5V+trPJrIC5wN6FbcbqQ0j3UhISMfjaCcV90M0Sj0OGjcqse/2eECFXdO5hAa7W24m An5PPV5b3Fph9ObhhL75u1UyPUQavgqqNM7SbSjPhunwpfQY5sp8PYG2DJ25vrlliGjn vA8Er0Hq3e3kx+H7GntF8/M38GryIro1nerlW5a6wmqckV39R3uEVRsNfWdGfc7xzJGz IoRA== 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=qKJAfoZxW6CcEJ4e8a+jIHh3UfMmaPIJTJRP9/d5eic=; b=m7feaqhmSKRI5oXMPrrVCGTwcPsndXYWAwxEW1hQD3arX1ZXu1TsVF7XJPu+Al3wBm QlJa898BX7+keL3emgAjcRhbXU7sz3ta3qtbTWmpo0SoBHRARAGw7rgHw46oscO0Sunv jZOYdBfP43h6YZS0wGo5KW8lRCLaD6kGLHCgVJ3JE0P4YJCkHLsuGDsUf4Zu4pPc8gBf E+m4aJe+vlRyXcNPDmfz1z70RQCa5aE+4+8tg6ScjLxMxjkTgvyRFQbXz4EragRyFeF7 Tl92y1F7bm3nuhTxkyWbMmhDeuQFpDY6GE/49n3/7xECWmeNWDyoC58wiAqMwzHu7rDB sYYw== X-Gm-Message-State: AOAM533RGI/TkSovZGqWZFA3/9ttxMYeJSsA9wBbAtdYBtFFtu3GwZDf KdGumkjEKSqpvapB/yxLDG0QvvzPLho= X-Google-Smtp-Source: ABdhPJzr04yHJRzX7FIx4h7iACT4zmpoTuW54XyBAQ+oI2W4WxnJZdt3mWU89CBE6aywJKFrHpApGQ== X-Received: by 2002:a62:8f4a:0:b029:20a:448e:7018 with SMTP id n71-20020a628f4a0000b029020a448e7018mr8186347pfd.62.1616681358517; Thu, 25 Mar 2021 07:09:18 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:18 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R , "Darrick J . Wong" Subject: [PATCH 3/6] xfs/531: Fix test to execute in multi-block directory config Date: Thu, 25 Mar 2021 19:38:54 +0530 Message-Id: <20210325140857.7145-3-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210325140857.7145-1-chandanrlinux@gmail.com> References: <20210325140857.7145-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs/531 attempts to create $testfile after reduce_max_iextents error tag is injected. Creation of $testfile fails when using a multi-block directory test configuration because, 1. A directory can have a pseudo maximum extent count of 10. 2. In the worst case a directory entry creation operation can consume (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block) extents. With 1k fs block size and 4k directory block size, this evaluates to, (5 + 1 + 1) * 4 = 7 * 4 = 28 > 10 (Pseudo maximum inode extent count). This commit fixes the issue by creating $testfile before injecting reduce_max_iextents error tag. Reported-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/531 | 11 ++++++++--- tests/xfs/531.out | 9 ++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/xfs/531 b/tests/xfs/531 index caec7848..935c52b0 100755 --- a/tests/xfs/531 +++ b/tests/xfs/531 @@ -49,13 +49,15 @@ nr_blks=30 testfile=$SCRATCH_MNT/testfile -echo "Inject reduce_max_iextents error tag" -_scratch_inject_error reduce_max_iextents 1 - for op in fpunch finsert fcollapse fzero; do echo "* $op regular file" echo "Create \$testfile" + touch $testfile + + echo "Inject reduce_max_iextents error tag" + _scratch_inject_error reduce_max_iextents 1 + $XFS_IO_PROG -f -s \ -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \ $testfile >> $seqres.full @@ -75,6 +77,9 @@ for op in fpunch finsert fcollapse fzero; do exit 1 fi + echo "Disable reduce_max_iextents error tag" + _scratch_inject_error reduce_max_iextents 0 + rm $testfile done diff --git a/tests/xfs/531.out b/tests/xfs/531.out index f85776c9..6ac90787 100644 --- a/tests/xfs/531.out +++ b/tests/xfs/531.out @@ -1,19 +1,26 @@ QA output created by 531 Format and mount fs -Inject reduce_max_iextents error tag * fpunch regular file Create $testfile +Inject reduce_max_iextents error tag fpunch alternating blocks Verify $testfile's extent count +Disable reduce_max_iextents error tag * finsert regular file Create $testfile +Inject reduce_max_iextents error tag finsert alternating blocks Verify $testfile's extent count +Disable reduce_max_iextents error tag * fcollapse regular file Create $testfile +Inject reduce_max_iextents error tag fcollapse alternating blocks Verify $testfile's extent count +Disable reduce_max_iextents error tag * fzero regular file Create $testfile +Inject reduce_max_iextents error tag fzero alternating blocks Verify $testfile's extent count +Disable reduce_max_iextents error tag From patchwork Thu Mar 25 14:08:55 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: 12164191 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.8 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=unavailable 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 C4CBFC433E9 for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AAC9E61A3C for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbhCYOJo (ORCPT ); Thu, 25 Mar 2021 10:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231386AbhCYOJV (ORCPT ); Thu, 25 Mar 2021 10:09:21 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2626C06174A; Thu, 25 Mar 2021 07:09:20 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id g15so2208264pfq.3; Thu, 25 Mar 2021 07:09:20 -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=/eaE6R17VwgmxiGoSjA6AeF9dbwTrXO5LHyeGFPtIw0=; b=kY1rLZueJyCrKR52EE337rheY84IZKGRbETy+XQGHD9fhdbTqObJB7eurK5I5UkeBm oOBGSl9Te/fFoDtbPHH1RIh6BxMYto8kAi9WT6+GYlnjUS5vgIc7VrepUJ8RRl166UUE hS/+jVFySVNAZgEMWUrin0AJctDro9+FwUAnoBbQfzqdLfXNPR4TS4vuDjTlbyw991tA t2VczFPlRlWDnMed6x5HHKinYNBjaPFb128nsPA/8SdsT9JrO+92OCF7JWtiFKqtIDzl hTfK0ebgysS9Ujpq/Iwo+f6XazOJ+QTsrohvhWD2Z1fQT3KrBTruX38HRDGlb24CuHRp ITFg== 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=/eaE6R17VwgmxiGoSjA6AeF9dbwTrXO5LHyeGFPtIw0=; b=mfRINbnGpWKS0bOvH/k0gn1NIaGPQBEOrHVQIF721IHDGXOnuSZnRFsRAhF5DBsANO r8WVLS5tP4onXK69zF11c8T12n1FFLdchLd7EdkW6RH0biGVetySUlczrUUctGMAYbNL U10yI2mSaBlKWwYNmlVtrzX+RBQQjrLKbSeq2Ywynxd0YzrxmC3WqKIfgN+ucfGiT1sL FKiIEdIGfTzO5D9t6qf07qanvQ+k/Z6T6EnXBXRkmsqtGT6K3pGQa7/A8d4+av1VaSmB AVGvQ1XG5pIByhUClAuOdkh6PCZWmoy80WkiFtZTf3sDgSKR5uZerWw8XYy1ksQ1Kv2T bSJQ== X-Gm-Message-State: AOAM532cuTpB1F9jFjZ1eLrAlcALpGqXKXVwV+F5nGN/puEupuEW/NCT LGfrbVzly4+HIsGjJFsbF+oGfj5JitQ= X-Google-Smtp-Source: ABdhPJxSLbm1nKmt8oJWU8YlxcBPoyUWtS678I1ocbypt1EfWsWtbJS9PY96HlJ4bctI0fdGRNwyBw== X-Received: by 2002:a62:2c85:0:b029:1ed:39f4:ca0f with SMTP id s127-20020a622c850000b02901ed39f4ca0fmr8472674pfs.11.1616681360346; Thu, 25 Mar 2021 07:09:20 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:20 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R , "Darrick J . Wong" Subject: [PATCH 4/6] xfs/532: Fix test to execute in multi-block directory config Date: Thu, 25 Mar 2021 19:38:55 +0530 Message-Id: <20210325140857.7145-4-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210325140857.7145-1-chandanrlinux@gmail.com> References: <20210325140857.7145-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs/532 attempts to create $testfile after reduce_max_iextents error tag is injected. Creation of $testfile fails when using a multi-block directory test configuration because, 1. A directory can have a pseudo maximum extent count of 10. 2. In the worst case a directory entry creation operation can consume (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block) extents. With 1k fs block size and 4k directory block size, this evaluates to, (5 + 1 + 1) * 4 = 7 * 4 = 28 > 10 (Pseudo maximum inode extent count). This commit fixes the issue by creating $testfile before injecting reduce_max_iextents error tag. Reported-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/532 | 17 ++++++++++------- tests/xfs/532.out | 6 +++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/xfs/532 b/tests/xfs/532 index 1c789217..2bed574a 100755 --- a/tests/xfs/532 +++ b/tests/xfs/532 @@ -63,9 +63,6 @@ for dentry in $(ls -1 $fillerdir/); do $here/src/punch-alternating $fillerdir/$dentry >> $seqres.full done -echo "Inject reduce_max_iextents error tag" -_scratch_inject_error reduce_max_iextents 1 - echo "Inject bmap_alloc_minlen_extent error tag" _scratch_inject_error bmap_alloc_minlen_extent 1 @@ -74,6 +71,9 @@ echo "* Set xattrs" echo "Create \$testfile" touch $testfile +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + echo "Create xattrs" nr_attrs=$((bsize * 20 / attr_len)) for i in $(seq 1 $nr_attrs); do @@ -90,6 +90,9 @@ if (( $naextents > 10 )); then exit 1 fi +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + echo "Remove \$testfile" rm $testfile @@ -98,9 +101,6 @@ echo "* Remove xattrs" echo "Create \$testfile" touch $testfile -echo "Disable reduce_max_iextents error tag" -_scratch_inject_error reduce_max_iextents 0 - echo "Create initial xattr extents" naextents=0 @@ -132,7 +132,10 @@ if [[ $? == 0 ]]; then exit 1 fi -rm $testfile && echo "Successfully removed \$testfile" +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + +rm $testfile # success, all done status=0 diff --git a/tests/xfs/532.out b/tests/xfs/532.out index 8e19d7bc..db52108f 100644 --- a/tests/xfs/532.out +++ b/tests/xfs/532.out @@ -2,17 +2,17 @@ QA output created by 532 Format and mount fs Consume free space Create fragmented filesystem -Inject reduce_max_iextents error tag Inject bmap_alloc_minlen_extent error tag * Set xattrs Create $testfile +Inject reduce_max_iextents error tag Create xattrs Verify $testfile's naextent count +Disable reduce_max_iextents error tag Remove $testfile * Remove xattrs Create $testfile -Disable reduce_max_iextents error tag Create initial xattr extents Inject reduce_max_iextents error tag Remove xattr to trigger -EFBIG -Successfully removed $testfile +Disable reduce_max_iextents error tag From patchwork Thu Mar 25 14:08:56 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: 12164193 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.8 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=unavailable 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 34989C433ED for ; Thu, 25 Mar 2021 14:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 011F961A26 for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbhCYOJp (ORCPT ); Thu, 25 Mar 2021 10:09:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231387AbhCYOJW (ORCPT ); Thu, 25 Mar 2021 10:09:22 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEFEFC06174A; Thu, 25 Mar 2021 07:09:22 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id c17so2192791pfn.6; Thu, 25 Mar 2021 07:09:22 -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=pSkPb8AvuKEiKWTkefXQ/u24x/nRRxa8+B+oOFLMDlw=; b=pgUmA36nNByA/PBjoCIdU0RCeyKq6JaUq/kK6/mK+6wKG3FDaVuaDAF2dH/q/YYvrl rd7D50htEqPiHI8fMPM7jxIQcudE06Ca1SxaUWoC60rc0+6plsNbfABs2UrxGCkprvX0 QPoN/fABVLi0afqC6ZgFD0QYAKQXNrWIg2wfekwNAC8XES8HZbzim73dJRU7YI2tmrah u8Z4VSv37ClEvS8d520tp0BDU0x8aZem9RR3wo/V0Bi8kWN/X4RcmlM4DpcLZZKEyQT1 YKn5Dg2miOELv0uS/EyyFOSDcceRspVGeUvJBYksu7N+kxEXv9Qa/2Zss5d/fYuWWjqf MgFg== 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=pSkPb8AvuKEiKWTkefXQ/u24x/nRRxa8+B+oOFLMDlw=; b=Cpt+iciWE+UjIPcrZsfq7nGpPnkjSAIvkYvrTmqygnKMgm7ycyJHhI08MYS32TTk/i dMidmUP5y7l5Gjzu70jT5LjR/y1HTOC6iVT9HGjuF3FL+2FLo7nyX6sgZeNaHsZK9zWL qcoQek3PeZY/X5Kngec7nPzomLu1QWOHlunEQ/PvVsot0ZciWrTWTYN4tTT4E06Uyb8r aMHzCaur7zf9Fqji3MW6Of99gVXsiAHSqHw/d9hLcOpx+/lzhHnT9QHNj+cJDi9BBBWP ioCKZ3LABFpLQY8y/E18ERZvm/P9mZmAWlc6XsTcfyKPGbarcVgswxCKoegq7y4YBDGi 3Chg== X-Gm-Message-State: AOAM530GLQmBMVaEk3QyzKCoz4+X6tCiIe+OrKgms5xVZypmF7T2NlIv iZya+XYib5mB1CXfeMroExKbh1EdR9U= X-Google-Smtp-Source: ABdhPJwS2n1wPieqf37216RwW9Nm3xAq9g3LpqVQt8Mn64cXgRzRL9tdTJgaR2xoMQs0r1elj1UNIw== X-Received: by 2002:a62:7c43:0:b029:1ef:20ce:ba36 with SMTP id x64-20020a627c430000b02901ef20ceba36mr8475349pfc.40.1616681362155; Thu, 25 Mar 2021 07:09:22 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:21 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R , "Darrick J . Wong" Subject: [PATCH 5/6] xfs/534: Fix test to execute in multi-block directory config Date: Thu, 25 Mar 2021 19:38:56 +0530 Message-Id: <20210325140857.7145-5-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210325140857.7145-1-chandanrlinux@gmail.com> References: <20210325140857.7145-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs/534 attempts to create $testfile after reduce_max_iextents error tag is injected. Creation of $testfile fails when using a multi-block directory test configuration because, 1. A directory can have a pseudo maximum extent count of 10. 2. In the worst case a directory entry creation operation can consume (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block) extents. With 1k fs block size and 4k directory block size, this evaluates to, (5 + 1 + 1) * 4 = 7 * 4 = 28 > 10 (Pseudo maximum inode extent count). This commit fixes the issue by creating $testfile before injecting reduce_max_iextents error tag. Reported-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/534 | 9 ++++++--- tests/xfs/534.out | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/xfs/534 b/tests/xfs/534 index a8348526..338282ef 100755 --- a/tests/xfs/534 +++ b/tests/xfs/534 @@ -45,9 +45,6 @@ bsize=$(_get_file_block_size $SCRATCH_MNT) testfile=${SCRATCH_MNT}/testfile -echo "Inject reduce_max_iextents error tag" -_scratch_inject_error reduce_max_iextents 1 - nr_blks=15 for io in Buffered Direct; do @@ -62,6 +59,9 @@ for io in Buffered Direct; do xfs_io_flag="-d" fi + echo "Inject reduce_max_iextents error tag" + _scratch_inject_error reduce_max_iextents 1 + echo "$io write to every other block of fallocated space" for i in $(seq 1 2 $((nr_blks - 1))); do $XFS_IO_PROG -f -s $xfs_io_flag -c "pwrite $((i * bsize)) $bsize" \ @@ -76,6 +76,9 @@ for io in Buffered Direct; do exit 1 fi + echo "Disable reduce_max_iextents error tag" + _scratch_inject_error reduce_max_iextents 0 + rm $testfile done diff --git a/tests/xfs/534.out b/tests/xfs/534.out index f7c0821b..0a0cd3a6 100644 --- a/tests/xfs/534.out +++ b/tests/xfs/534.out @@ -1,11 +1,14 @@ QA output created by 534 Format and mount fs -Inject reduce_max_iextents error tag * Buffered write to unwritten extent Fallocate 15 blocks +Inject reduce_max_iextents error tag Buffered write to every other block of fallocated space Verify $testfile's extent count +Disable reduce_max_iextents error tag * Direct write to unwritten extent Fallocate 15 blocks +Inject reduce_max_iextents error tag Direct write to every other block of fallocated space Verify $testfile's extent count +Disable reduce_max_iextents error tag From patchwork Thu Mar 25 14:08:57 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: 12164195 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.8 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=unavailable 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 0C53AC433EA for ; Thu, 25 Mar 2021 14:10:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CCC4F61A2E for ; Thu, 25 Mar 2021 14:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230134AbhCYOJp (ORCPT ); Thu, 25 Mar 2021 10:09:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbhCYOJY (ORCPT ); Thu, 25 Mar 2021 10:09:24 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B30EC06174A; Thu, 25 Mar 2021 07:09:24 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id f10so1882195pgl.9; Thu, 25 Mar 2021 07:09:24 -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=DC5g5ebjEu4icrsUDPwfgCtRYs/q1+XpwvMS3l0pOOc=; b=JdAFkH0kIIOmk68RBUvMIFSxnGu5/wINE/xvjqtwTalCmgxVDhZ2x+b9S5VTlIdaWe CwFLuZHarMA0l6fbou1lIY1Cq8u3G/+9u9L/69QYqLpy+KqUXYvbubFbEoPKppI5ZWH9 3/QjrE1B+zwYkVg9ZHryNIhhPjir0F1Gxj/kdtd9gDd8Q9HNjXKOMXUa7FA7igGyW/q+ rnrfs+TdSaBOvGJobq7CPchhcd2q10yPw4uZxCzYaEKUpmftMQ9kA094fIakTHNta2HV ZHwMaarOowX4BCPlv+KMCITqH+lHfaYs6grsJZEbzynAvNKtXkemzNKalVIr+uhCNqZ2 pzZw== 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=DC5g5ebjEu4icrsUDPwfgCtRYs/q1+XpwvMS3l0pOOc=; b=B9rFkoa76ISbOjI1RR3KylXURtIZYvxlVellSfbzdaeJouL4T7KObdGbAfWlHV9o4B 2c9tfJNXzxEcozYRlysuNxJ2SdhzLb7rYQC+1ky+QpcSOanECpdY3PJD5out3TygJTpi BQ3SvBMYoYvEvxTrch+WF5cdUJgaTgckQYuetSpbXDMigFtENpSC2P23Tr4FcJtTJ2HK jSZOW84vxn0ibMLt/B7f2F4w0j5NLq5HBlKBt9sRIyGGRoL5uQF83lmt0wcn8cp2SCaA q75QNI6Cin61/lvW6sPU8XDkN99EgvtL0ZKHxpGc7TZuOCfJ5A7TVXfomYWWTM0WUhm3 UW9w== X-Gm-Message-State: AOAM533gXmmzOdo3nnuCuYEkFvEmdl1u7hHkRer0yx9bj/a89vyhlWcd Ig6/5u6LqhK7+tftV7djzmDLpX59RdI= X-Google-Smtp-Source: ABdhPJwuATbyiHuXPjj8nu05D25okTqL0zVlykrT3LRA00z1NOsN2RX0lkojVqMZSAEQ022t0di5ng== X-Received: by 2002:a17:902:b60b:b029:e6:ef44:5231 with SMTP id b11-20020a170902b60bb02900e6ef445231mr9783721pls.79.1616681364037; Thu, 25 Mar 2021 07:09:24 -0700 (PDT) Received: from localhost.localdomain ([122.171.175.121]) by smtp.gmail.com with ESMTPSA id v13sm5673030pfu.54.2021.03.25.07.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 07:09:23 -0700 (PDT) From: Chandan Babu R To: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Cc: Chandan Babu R , "Darrick J . Wong" Subject: [PATCH 6/6] xfs/535: Fix test to execute in multi-block directory config Date: Thu, 25 Mar 2021 19:38:57 +0530 Message-Id: <20210325140857.7145-6-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210325140857.7145-1-chandanrlinux@gmail.com> References: <20210325140857.7145-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org xfs/535 attempts to create $srcfile and $dstfile after reduce_max_iextents error tag is injected. Creation of these files fails when using a multi-block directory test configuration because, 1. A directory can have a pseudo maximum extent count of 10. 2. In the worst case a directory entry creation operation can consume (XFS_DA_NODE_MAXDEPTH + 1 + 1) * (Nr fs blocks in a single directory block) extents. With 1k fs block size and 4k directory block size, this evaluates to, (5 + 1 + 1) * 4 = 7 * 4 = 28 > 10 (Pseudo maximum inode extent count). This commit fixes the issue by creating $srcfile and $dstfile before injecting reduce_max_iextents error tag. Reported-by: Darrick J. Wong Suggested-by: Darrick J. Wong Signed-off-by: Chandan Babu R Reviewed-by: Darrick J. Wong --- tests/xfs/535 | 11 +++++++++++ tests/xfs/535.out | 2 ++ 2 files changed, 13 insertions(+) diff --git a/tests/xfs/535 b/tests/xfs/535 index 2d82624c..f2a8a3a5 100755 --- a/tests/xfs/535 +++ b/tests/xfs/535 @@ -51,6 +51,9 @@ nr_blks=15 srcfile=${SCRATCH_MNT}/srcfile dstfile=${SCRATCH_MNT}/dstfile +touch $srcfile +touch $dstfile + echo "Inject reduce_max_iextents error tag" _scratch_inject_error reduce_max_iextents 1 @@ -77,10 +80,18 @@ if (( $nextents > 10 )); then exit 1 fi +echo "Disable reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 0 + rm $dstfile echo "* Funshare shared extent" +touch $dstfile + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + echo "Share the extent with \$dstfile" _reflink $srcfile $dstfile >> $seqres.full diff --git a/tests/xfs/535.out b/tests/xfs/535.out index 4383e921..8f600272 100644 --- a/tests/xfs/535.out +++ b/tests/xfs/535.out @@ -6,7 +6,9 @@ Create a $srcfile having an extent of length 15 blocks Share the extent with $dstfile Buffered write to every other block of $dstfile's shared extent Verify $dstfile's extent count +Disable reduce_max_iextents error tag * Funshare shared extent +Inject reduce_max_iextents error tag Share the extent with $dstfile Funshare every other block of $dstfile's shared extent Verify $dstfile's extent count