From patchwork Tue Jan 12 07:40:17 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: 12012573 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 40B54C433E0 for ; Tue, 12 Jan 2021 07:41:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3A1D20789 for ; Tue, 12 Jan 2021 07:41:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732521AbhALHlb (ORCPT ); Tue, 12 Jan 2021 02:41:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730190AbhALHlb (ORCPT ); Tue, 12 Jan 2021 02:41:31 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAD63C061794; Mon, 11 Jan 2021 23:40:50 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id h10so880091pfo.9; Mon, 11 Jan 2021 23:40:50 -0800 (PST) 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=tuRANglPuvCThAaGoAF4a7CUchGXxnbMIAXQeoen4YY=; b=usisPELkuG/Xu6/jsf3bH44hLVmemTJ5aR1XYtDtUYKfiQZ194Oho+KUmN/e5Q3zkB zRhsCvv8g9jgY0A9PzdHJJYT707A1mp+i6voKfEBQW9YAln7C4Ji+zAP+Z2iZl782tYt 4ckFyMUfQw+8ryp5we1NrKLbCixxudCcBYyFE6cPqsfJjINXPVhyKntnXJhF1RUzXQjw QW/QHZO96o9AX0xI7baLdL8ej5DgtRhbmucRzTOZ+9wccAlrXMknJHNou5VlPf4qNm3B kwlbY9PhmZEGWTkJzQ7nxXl1wAWhBRVRe9Aa9nvoVJPsXZ/G79UoK9762cQu78zo+Mr0 qfYw== 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=tuRANglPuvCThAaGoAF4a7CUchGXxnbMIAXQeoen4YY=; b=COZudaLD/svagusHcdP8y15Uo2lbgt3tTFgikefKL4P4VKr6TsnyOuy/bS+JDRIUE6 3RAJX/M98TWUL2N7/ulV/c6SwgiynGN83AOtCmE9KtOk3jOUDU3c566ZjXPoRnwZWTRT 0SHhYZKqjZLDm4y1O7mH2NVHVFEPr8C04nm9N5rTXWuuIoMIAJcj85hDVA/sActuH57c /9sa3Bkk3GupNHvVLVQYumfrqSnsK581ejBGAAqJUG9hg0xbEnG7p8RYDX4WTkVmZMVl /OaJ19jXHhzU7WP3F6xWEEDM0APaKu3wj/D6C039D35yZiAyE1xM69jjLtN3UshVmwth jh2w== X-Gm-Message-State: AOAM532X4Br1W67k5nBW/OWVQJWh1mvtCuqIxbO+RH30q5YASiSlGHaY UA1lGoau9+V+es51N4kijSy/rTNJXlQ= X-Google-Smtp-Source: ABdhPJx/uKACnT/2cOSEuLPYCacSgUn/7w8kRTqa+VKtlGX2Gp3T4us6iqqSKOk/sU6ex/8z0H4AoQ== X-Received: by 2002:a62:14d3:0:b029:19e:88c0:8c67 with SMTP id 202-20020a6214d30000b029019e88c08c67mr3318651pfu.69.1610437250259; Mon, 11 Jan 2021 23:40:50 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:40:49 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 01/11] common/xfs: Add a helper to get an inode fork's extent count Date: Tue, 12 Jan 2021 13:10:17 +0530 Message-Id: <20210112074027.10311-2-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit adds the helper _scratch_get_iext_count() which returns an inode fork's extent count. Signed-off-by: Chandan Babu R --- common/xfs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/common/xfs b/common/xfs index 3f5c14ba..641d6195 100644 --- a/common/xfs +++ b/common/xfs @@ -903,6 +903,28 @@ _scratch_get_bmx_prefix() { return 1 } +_scratch_get_iext_count() +{ + ino=$1 + whichfork=$2 + + case $whichfork in + "attr") + field=core.naextents + ;; + "data") + field=core.nextents + ;; + *) + return 1 + esac + + nextents=$(_scratch_xfs_db -c "inode $ino" -c "print $field") + nextents=${nextents##${field} = } + + echo $nextents +} + # # Ensures that we don't pass any mount options incompatible with XFS v4 # From patchwork Tue Jan 12 07:40:18 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: 12012575 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=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 46757C433E0 for ; Tue, 12 Jan 2021 07:41:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17E2922CE3 for ; Tue, 12 Jan 2021 07:41:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732736AbhALHld (ORCPT ); Tue, 12 Jan 2021 02:41:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732633AbhALHld (ORCPT ); Tue, 12 Jan 2021 02:41:33 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4011FC061795; Mon, 11 Jan 2021 23:40:53 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id z21so892241pgj.4; Mon, 11 Jan 2021 23:40:53 -0800 (PST) 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=vF1fNODhrx13x0o0QEOf/SUQ3aSLAlFQl7nUWX9z7Ow=; b=Zx21UwV2MZx1Shh3kTAEwDgrPPf2PbgCPQT25YTDBYj1Xo0THt30SBtCFID/JttgOn Nk0CCra+kn9P7jTVxQtH/upWnRiZm8iRHdzNQ0uDvxBfWUI4k4g/E73v1sb5dTWAqCnb hFpoTsQ1nsyWWon6y/IcxtehbxJ01nEmXsUQygpt8AsB3JmfICpir7HZ81WKtn0vcOx2 zk5dC09eF27zLLWmup8Jhe3mEw6iUvfoULvJgkleotDhV/McoJd7rHlNnk0DXTs+lS3W j/WRhQZ/+K+0UNESEWUCWag68tIShBaEQxa/yw4N2ng6p2tHL1auNSsLGFl3iSz913rV Z+PA== 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=vF1fNODhrx13x0o0QEOf/SUQ3aSLAlFQl7nUWX9z7Ow=; b=MwPdIs2lsoPA9Wlur22edL9Bj2b8M2wFDNCtk9X0sCrRzYExRNFHoKhfHVC+Zlreye +MOZ1kWWObQKSIhjxfdZsHJj1a+R0oCl3cj6x11bHWQDiMV+tjt0x9gLbe10yEP30rz+ aQfP7uBaLBlKwJofdoPQpYNs02cpdr7paOijZT+RCr7R7E9mxcp88jLQDvwnStTTHttK hXbi420/I7a2VGrQKikzsQZj0wgbUXNoNYc5ak34IEKClaJpqUl9qaNzEYHYhe2BjyvZ 0ga+b1DdFP0OUtjlik1EkzcOqN9Vk/bla1Pvs6YY/hJSr/KRZKB1sS2fsugwnN6hJ688 anaQ== X-Gm-Message-State: AOAM530Dbmg9fLfd0/iptgjQsMT/+lBRhnmKktWdoIFSgm+bYkWfJgsN op/mYrATdNSU3MTsFnet+2hrsA+wp1w= X-Google-Smtp-Source: ABdhPJyCEAiEAwJQkGcqwjNxObV1QHvwTHA2TrY16ncZ5bZy2cPNFPAdCULawRfdNA7/2P0U/xYYTw== X-Received: by 2002:a62:ac09:0:b029:1a9:dd65:2f46 with SMTP id v9-20020a62ac090000b02901a9dd652f46mr3655067pfe.15.1610437252643; Mon, 11 Jan 2021 23:40:52 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:40:52 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 02/11] xfs: Check for extent overflow when trivally adding a new extent Date: Tue, 12 Jan 2021 13:10:18 +0530 Message-Id: <20210112074027.10311-3-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when adding a single extent while there's no possibility of splitting an existing mapping. Signed-off-by: Chandan Babu R --- tests/xfs/522 | 173 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/522.out | 20 ++++++ tests/xfs/group | 1 + 3 files changed, 194 insertions(+) create mode 100755 tests/xfs/522 create mode 100644 tests/xfs/522.out diff --git a/tests/xfs/522 b/tests/xfs/522 new file mode 100755 index 00000000..33f0591e --- /dev/null +++ b/tests/xfs/522 @@ -0,0 +1,173 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 522 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# adding a single extent while there's no possibility of splitting an existing +# mapping. + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/quota +. ./common/inject +. ./common/populate + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_quota +_require_xfs_debug +_require_test_program "punch-alternating" +_require_xfs_io_command "falloc" +_require_xfs_io_error_injection "reduce_max_iextents" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +echo "Format and mount fs" +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mount -o uquota >> $seqres.full + +bsize=$(_get_file_block_size $SCRATCH_MNT) + +echo "* Delalloc to written extent conversion" + +testfile=$SCRATCH_MNT/testfile + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + +nr_blks=$((15 * 2)) + +echo "Create fragmented file" +for i in $(seq 0 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -s -c "pwrite $((i * bsize)) $bsize" $testfile \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$testfile's extent count" + +nextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep -i nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm $testfile + +echo "* Fallocate unwritten extents" + +echo "Fallocate fragmented file" +for i in $(seq 0 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -c "falloc $((i * bsize)) $bsize" $testfile \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$testfile's extent count" + +nextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep -i nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm $testfile + +echo "* Directio write" + +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 \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$testfile's extent count" + +nextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep -i nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm $testfile + +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) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((bsize * nr_free_blks)) $fillerdir $bsize 0 >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +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 + +nr_blks=20 + +# This is a rough calculation; It doesn't take block headers into +# consideration. +# gdb -batch vmlinux -ex 'print sizeof(struct xfs_dqblk)' +# $1 = 136 +nr_quotas_per_block=$((bsize / 136)) +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 + [[ $? != 0 ]] && break +done + +_scratch_unmount >> $seqres.full + +echo "Verify uquota inode's extent count" +uquotino=$(_scratch_xfs_db -c sb -c "print uquotino") +uquotino=${uquotino##uquotino = } + +nextents=$(_scratch_get_iext_count $uquotino data || \ + _fail "Unable to obtain inode fork's extent count") +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/522.out b/tests/xfs/522.out new file mode 100644 index 00000000..debeb004 --- /dev/null +++ b/tests/xfs/522.out @@ -0,0 +1,20 @@ +QA output created by 522 +Format and mount fs +* Delalloc to written extent conversion +Inject reduce_max_iextents error tag +Create fragmented file +Verify $testfile's extent count +* Fallocate unwritten extents +Fallocate fragmented file +Verify $testfile's extent count +* Directio write +Create fragmented file via directio writes +Verify $testfile's extent count +* Extend quota inodes +Disable reduce_max_iextents error tag +Consume free space +Create fragmented filesystem +Inject reduce_max_iextents error tag +Inject bmap_alloc_minlen_extent error tag +Extend uquota file +Verify uquota inode's extent count diff --git a/tests/xfs/group b/tests/xfs/group index 17f6bc6c..6aff1210 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -519,6 +519,7 @@ 519 auto quick reflink 520 auto quick reflink 521 auto quick realtime growfs +522 auto quick quota 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:19 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: 12012577 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 080E9C433E6 for ; Tue, 12 Jan 2021 07:41:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD60A22D05 for ; Tue, 12 Jan 2021 07:41:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732854AbhALHlg (ORCPT ); Tue, 12 Jan 2021 02:41:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732633AbhALHlf (ORCPT ); Tue, 12 Jan 2021 02:41:35 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A72B3C0617A2; Mon, 11 Jan 2021 23:40:55 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id y8so948095plp.8; Mon, 11 Jan 2021 23:40:55 -0800 (PST) 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=ivq6xJwshcxaTWJE436xhKQRZqFsobKDzWQjELuY43Q=; b=kjHDiYhDSGEMZ55kOded1eoUWtmBQCDVnBCqlA84o0FvMc6V4+b8tHmQXIWwC3uEYa pll46ION7Zgmq2tEQQ047DLm3AOlG8e1UH76GTR/p8Z3CKqUIiU36sVDf29ENvEtfeJ9 RfQBrkljrz1SrwvThhxpnk3Ikdo2Al1udzwTiVSqCg4Xn8zOZabe0CnwX0UwjqfmMd77 1XolQsdNWMKCXuona4eKFEoKv0Vy0755rKiKuqbPfiQFgqvODj5eQt5pulSMUmEWtSM1 d/cVDiNd/i/lAqK/+2cBwhLLLC7wkA5gBkyKKEpL0oIdk+rsPXFcdZ0/rQuIx38SYvf4 QZ8g== 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=ivq6xJwshcxaTWJE436xhKQRZqFsobKDzWQjELuY43Q=; b=iPgMXNxYf69Ku63m25fSD2ut6boTNi79RH7XLj1OpOMcJGMnaTH/E8tBQc0V+fmG6L SJTxJpSs3Op+KRrHYMEum8hMZj37LB4aASpc8nNnS6kAzvbx60qUzDUAY2SuSZwCjOlW 5Ds+0OsKcCa3oigqbUr72nXo3eALfYoAaN28vkB9x5eReVvjHOgsAmYyUZIhEhZxQmpB hzNuL4tvuQ2SNMA2k36zBXpylOgb/l3Ss/4FtYa8ExN1Jypn8GHzYCDpyaQu+CAsyBaQ HLka205cLTHxGTRIrRgTiMxnwUwbARCs5OcWiMBSH/ZHA8ZaFTXrKI3j8Hle4IsQZxqm 35fg== X-Gm-Message-State: AOAM530r5TJ3AL0Jjy2M+jx/bHVoxry+n2/Og/kBx35QCalsBLeVTNsj d/qoHnMcoMXcFFLI+q+6nZ6qVI8o7bQ= X-Google-Smtp-Source: ABdhPJxD78FhFdziyiVps/NAbGXUeHswCFtq6T6GidRisA8ISNOySMpnVnq7Mo1YcWlEQqRsCYr5bA== X-Received: by 2002:a17:902:6bca:b029:dc:34e1:26b1 with SMTP id m10-20020a1709026bcab02900dc34e126b1mr3997230plt.52.1610437254949; Mon, 11 Jan 2021 23:40:54 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:40:54 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 03/11] xfs: Check for extent overflow when growing realtime bitmap/summary inodes Date: Tue, 12 Jan 2021 13:10:19 +0530 Message-Id: <20210112074027.10311-4-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Verify that XFS does not cause realtime bitmap/summary inode fork's extent count to overflow when growing the realtime volume associated with a filesystem. Signed-off-by: Chandan Babu R --- tests/xfs/523 | 119 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/523.out | 11 +++++ tests/xfs/group | 1 + 3 files changed, 131 insertions(+) create mode 100755 tests/xfs/523 create mode 100644 tests/xfs/523.out diff --git a/tests/xfs/523 b/tests/xfs/523 new file mode 100755 index 00000000..145f0ff6 --- /dev/null +++ b/tests/xfs/523 @@ -0,0 +1,119 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 523 +# +# Verify that XFS does not cause bitmap/summary inode fork's extent count to +# overflow when growing an the realtime volume of the filesystem. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + _scratch_unmount >> $seqres.full 2>&1 + test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1 + rm -f $tmp.* $TEST_DIR/$seq.rtvol +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject +. ./common/populate + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_test +_require_xfs_debug +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "reduce_max_iextents" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" +_require_scratch_nocheck + +echo "* Test extending rt inodes" + +_scratch_mkfs | _filter_mkfs >> $seqres.full 2> $tmp.mkfs +. $tmp.mkfs + +echo "Create fake rt volume" +nr_bitmap_blks=25 +nr_bits=$((nr_bitmap_blks * dbsize * 8)) +rtextsz=$dbsize +rtdevsz=$((nr_bits * rtextsz)) +truncate -s $rtdevsz $TEST_DIR/$seq.rtvol +rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol) + +echo "Format and mount rt volume" + +export USE_EXTERNAL=yes +export SCRATCH_RTDEV=$rtdev +_scratch_mkfs -d size=$((1024 * 1024 * 1024)) \ + -r size=2M,extsize=${rtextsz} >> $seqres.full +_scratch_mount >> $seqres.full + +echo "Consume free space" +fillerdir=$SCRATCH_MNT/fillerdir +nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((dbsize * nr_free_blks)) $fillerdir $dbsize 0 >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +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 + +echo "Grow realtime volume" +$XFS_GROWFS_PROG -r $SCRATCH_MNT >> $seqres.full 2>&1 +if [[ $? == 0 ]]; then + echo "Growfs succeeded; should have failed." + exit 1 +fi + +_scratch_unmount >> $seqres.full + +echo "Verify rbmino's and rsumino's extent count" +for rtino in rbmino rsumino; do + ino=$(_scratch_xfs_db -c sb -c "print $rtino") + ino=${ino##${rtino} = } + echo "$rtino = $ino" >> $seqres.full + + nextents=$(_scratch_get_iext_count $ino data || \ + _fail "Unable to obtain inode fork's extent count") + if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 + fi +done + +echo "Check filesystem" +_check_xfs_filesystem $SCRATCH_DEV none $rtdev + +losetup -d $rtdev +rm -f $TEST_DIR/$seq.rtvol + +export USE_EXTERNAL="" +export SCRATCH_RTDEV="" + +# success, all done +status=0 +exit diff --git a/tests/xfs/523.out b/tests/xfs/523.out new file mode 100644 index 00000000..7df02970 --- /dev/null +++ b/tests/xfs/523.out @@ -0,0 +1,11 @@ +QA output created by 523 +* Test extending rt inodes +Create fake rt volume +Format and mount rt volume +Consume free space +Create fragmented filesystem +Inject reduce_max_iextents error tag +Inject bmap_alloc_minlen_extent error tag +Grow realtime volume +Verify rbmino's and rsumino's extent count +Check filesystem diff --git a/tests/xfs/group b/tests/xfs/group index 6aff1210..b375a94c 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -520,6 +520,7 @@ 520 auto quick reflink 521 auto quick realtime growfs 522 auto quick quota +523 auto quick realtime growfs 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:20 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: 12012579 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=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 5ECEAC433E6 for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BD8F22E02 for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731152AbhALHmJ (ORCPT ); Tue, 12 Jan 2021 02:42:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727076AbhALHmJ (ORCPT ); Tue, 12 Jan 2021 02:42:09 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC5C8C0617A3; Mon, 11 Jan 2021 23:40:57 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id g3so965258plp.2; Mon, 11 Jan 2021 23:40:57 -0800 (PST) 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=KSmrcvw5ZUJlTQHKIeh4tHzJvLM/jJb0v/5lnrJ6Kp0=; b=dzwuUAr2EXcDXKrI0YnIlUOmFTRInZLrANUqXkHh8rpn/J6Ymo0jq9lmkEz95s9jpH iWCmKS7pQN3foqI/6WPOrqcY3MVE8e0GWehjhoWDGgNkbdS6YoysuKlQyv9nrW+xgLMn jUPV5qC409myTNZ2VEL3nd1LrJbeyFFSeRI5VPqYk+9jk0WD4sOgHqs7ZLPMlPnQXL6V GX7QTLEj0oH2Ni3aZWiMxf7XLwPsgxR4HfoQUW6fEGJDtLU73LWWX/QCgcRck8PyLbQ5 r2PKT+UGpn1vSz8wzVEz78MDvgJd0AWpe0sbWelxZZUqwkm/JHsfc/gJYDR4pJMEhXwN nXGg== 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=KSmrcvw5ZUJlTQHKIeh4tHzJvLM/jJb0v/5lnrJ6Kp0=; b=PpervOutKmEuQhbNkXlcoL5CA0RvGyFcYEO9Hz2thOmN1XtesmJpBTknzZa4QhKZ9H V2jSFybzUHdGSUBwwHpcRQ7ZvMvNGgrFs+tlY5jRWpY3+rsvaRYGuB0ZElMZpiDIoG3P cxYPyWtuKVwnbq7BgP/3aHQrs6+erS5SKE7kkgADQd9fpXOqGPvjmniNUjAMsDYhjvOG fUKjhMHi1YYTtiXdQ4n+J3tkSJKROvU4KDhltMj90pkrgiKE2js54PR3DuNhGDsIWOuD dbhLx5WTCXcF+04azM+dnJSIztidoyEKZP4AVyD1U5Pxo1lDjZ0SxLpAk+875lBGSr2v 5bFQ== X-Gm-Message-State: AOAM531ivLCCJqY59GRWJY6CuAa3eM6+djI5wv3eHHkpDiMbtBR7OWhS BR9B8U55PI0D8vXksUvczPqYy2u9hQI= X-Google-Smtp-Source: ABdhPJxYJrIR3cJ+gQDJ9PS5JiFh0p9sJzWcO3TlLU6Jx233PozCuYkTFlmG5RZUS+GLx8rH1KdMmg== X-Received: by 2002:a17:90a:3d4e:: with SMTP id o14mr3188582pjf.44.1610437257236; Mon, 11 Jan 2021 23:40:57 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:40:56 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 04/11] xfs: Check for extent overflow when punching a hole Date: Tue, 12 Jan 2021 13:10:20 +0530 Message-Id: <20210112074027.10311-5-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when punching out an extent. Signed-off-by: Chandan Babu R --- tests/xfs/524 | 84 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/524.out | 19 +++++++++++ tests/xfs/group | 1 + 3 files changed, 104 insertions(+) create mode 100755 tests/xfs/524 create mode 100644 tests/xfs/524.out diff --git a/tests/xfs/524 b/tests/xfs/524 new file mode 100755 index 00000000..79fa31d8 --- /dev/null +++ b/tests/xfs/524 @@ -0,0 +1,84 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 524 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# punching out an extent. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_debug +_require_xfs_io_command "fpunch" +_require_xfs_io_command "finsert" +_require_xfs_io_command "fcollapse" +_require_xfs_io_command "fzero" +_require_xfs_io_error_injection "reduce_max_iextents" + +echo "Format and mount fs" +_scratch_mkfs >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_file_block_size $SCRATCH_MNT) +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" + $XFS_IO_PROG -f -s \ + -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \ + $testfile >> $seqres.full + + echo "$op alternating blocks" + for i in $(seq 1 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -c "$op $((i * bsize)) $bsize" $testfile \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break + done + + echo "Verify \$testfile's extent count" + + nextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep -i nextents) + nextents=${nextents##fsxattr.nextents = } + if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 + fi + + rm $testfile +done + +# success, all done +status=0 +exit diff --git a/tests/xfs/524.out b/tests/xfs/524.out new file mode 100644 index 00000000..a957f9c7 --- /dev/null +++ b/tests/xfs/524.out @@ -0,0 +1,19 @@ +QA output created by 524 +Format and mount fs +Inject reduce_max_iextents error tag +* fpunch regular file +Create $testfile +fpunch alternating blocks +Verify $testfile's extent count +* finsert regular file +Create $testfile +finsert alternating blocks +Verify $testfile's extent count +* fcollapse regular file +Create $testfile +fcollapse alternating blocks +Verify $testfile's extent count +* fzero regular file +Create $testfile +fzero alternating blocks +Verify $testfile's extent count diff --git a/tests/xfs/group b/tests/xfs/group index b375a94c..7031cabf 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -521,6 +521,7 @@ 521 auto quick realtime growfs 522 auto quick quota 523 auto quick realtime growfs +524 auto quick punch zero insert collapse 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:21 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: 12012581 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=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 848C0C433E9 for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46A8322EBE for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387521AbhALHmJ (ORCPT ); Tue, 12 Jan 2021 02:42:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728520AbhALHmJ (ORCPT ); Tue, 12 Jan 2021 02:42:09 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3364EC0617A4; Mon, 11 Jan 2021 23:41:00 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id y8so948205plp.8; Mon, 11 Jan 2021 23:41:00 -0800 (PST) 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=Uf7wmL9C06Pm1NNR4aoRM356vneLUa/1yf8fzzPP1Ns=; b=d81GoICA7cNY5mbDx13yddOJvTrxLLIXBgJlpf5E8thwglzJMK76ypJdwi85m10GOg dzJUILU5CVgaYG0EkaElmEaiU/16356eeoLZhxVJh4RpA6pwJSiXdt+EwQSPxa/tN/sp JQA5i/wybF3FPZMVBXSHaDVx8Ty8f5iwaJxf0XG//FAtUs/Of2fCokHh3DBXjQcJhFvB HQMugcZYdx3SZTNbFUsMOov47UQrnwkxaZ3w6k0dDKOdl1c2eta/Q2Xb2RV/3epkhCWh Mgr5ArIjvlJlvyhAQTzJgoK0TMZ1IMtOQabWFD6uENNHx3RF55pHb+VvRBiTtkuwOKuY YCzg== 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=Uf7wmL9C06Pm1NNR4aoRM356vneLUa/1yf8fzzPP1Ns=; b=H7PvMTDr0z8+cO4Fdgj7DKXNrxpCe8mkJrreUpWT/2shkncwjB66gAwLc0EHltIdos aG9YrkqALN0Wd1C7cQxOCBcuTzDZy2bQF5owjiEKc1DOxa8GTAJ3aQRaSvgwhZpMNtVs 5s5waFkBGVbOR6bAj04WjmM4YrbZsjE58RWljF9N/QPMUsmsPb5+OZBP+6MJKwno8OZn C7rfmrzkgepAFFAFr8oy8ZanqNxAmVQM7BTdUCtEAXgp47e9QltEAUc85cMG+CCCyGgq EEAQDL/K97dovrcMjh8NzUiYNvircPCJZL/7KGrtmHvfsBCSMEoEBfm2NVb+gSJ6If1B ARDw== X-Gm-Message-State: AOAM530HWSuxGRn/Q37ymc4A8RIKWm3DlR52+HUGTMqSXe0047xtGJFZ QTtDNAFofGP1BMQjI5UcHpCYc9T+1Qo= X-Google-Smtp-Source: ABdhPJypjLYsJgGhyJ7ZhRXaByUOTcSabiuB0b44UxOAfVy5jAo2uk71JvhQttPR8h6OFvFZ2KrJJw== X-Received: by 2002:a17:90a:db0d:: with SMTP id g13mr2011308pjv.76.1610437259527; Mon, 11 Jan 2021 23:40:59 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:40:59 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 05/11] xfs: Check for extent overflow when adding/removing xattrs Date: Tue, 12 Jan 2021 13:10:21 +0530 Message-Id: <20210112074027.10311-6-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when adding/removing xattrs. Signed-off-by: Chandan Babu R --- tests/xfs/525 | 141 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/525.out | 18 ++++++ tests/xfs/group | 1 + 3 files changed, 160 insertions(+) create mode 100755 tests/xfs/525 create mode 100644 tests/xfs/525.out diff --git a/tests/xfs/525 b/tests/xfs/525 new file mode 100755 index 00000000..bdca846d --- /dev/null +++ b/tests/xfs/525 @@ -0,0 +1,141 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 525 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# Adding/removing xattrs. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/attr +. ./common/inject +. ./common/populate + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_attrs +_require_xfs_debug +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "reduce_max_iextents" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +echo "Format and mount fs" +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_block_size $SCRATCH_MNT) + +attr_len=255 + +testfile=$SCRATCH_MNT/testfile + +echo "Consume free space" +fillerdir=$SCRATCH_MNT/fillerdir +nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((bsize * nr_free_blks)) $fillerdir $bsize 0 >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +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 + +echo "* Set xattrs" + +echo "Create \$testfile" +touch $testfile + +echo "Create xattrs" +nr_attrs=$((bsize * 20 / attr_len)) +for i in $(seq 1 $nr_attrs); do + attr="$(printf "trusted.%0247d" $i)" + $SETFATTR_PROG -n "$attr" $testfile >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$testfile's naextent count" + +naextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep naextents) +naextents=${naextents##fsxattr.naextents = } +if (( $naextents > 10 )); then + echo "Extent count overflow check failed: naextents = $naextents" + exit 1 +fi + +echo "Remove \$testfile" +rm $testfile + +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 +last="" +start=1 +nr_attrs=$((bsize / attr_len)) + +while (( $naextents < 4 )); do + end=$((start + nr_attrs - 1)) + + for i in $(seq $start $end); do + attr="$(printf "trusted.%0247d" $i)" + $SETFATTR_PROG -n $attr $testfile + done + + start=$((end + 1)) + + naextents=$($XFS_IO_PROG -f -c 'stat' $testfile | grep naextents) + naextents=${naextents##fsxattr.naextents = } +done + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + +echo "Remove xattr to trigger -EFBIG" +attr="$(printf "trusted.%0247d" 1)" +$SETFATTR_PROG -x "$attr" $testfile >> $seqres.full 2>&1 +if [[ $? == 0 ]]; then + echo "Xattr removal succeeded; Should have failed " + exit 1 +fi + +rm $testfile && echo "Successfully removed \$testfile" + +# success, all done +status=0 +exit diff --git a/tests/xfs/525.out b/tests/xfs/525.out new file mode 100644 index 00000000..74b152d9 --- /dev/null +++ b/tests/xfs/525.out @@ -0,0 +1,18 @@ +QA output created by 525 +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 +Create xattrs +Verify $testfile's naextent count +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 diff --git a/tests/xfs/group b/tests/xfs/group index 7031cabf..bfaac6aa 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -522,6 +522,7 @@ 522 auto quick quota 523 auto quick realtime growfs 524 auto quick punch zero insert collapse +525 auto quick attr 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:22 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: 12012585 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 E2C1BC4332D for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD05822E03 for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390064AbhALHmL (ORCPT ); Tue, 12 Jan 2021 02:42:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728520AbhALHmL (ORCPT ); Tue, 12 Jan 2021 02:42:11 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D5E7C0617A5; Mon, 11 Jan 2021 23:41:02 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d4so142718plh.5; Mon, 11 Jan 2021 23:41:02 -0800 (PST) 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=Wv0wC0Y2nMa7sKfq74YthnNcLgGAK5vR9W3+DouTvpU=; b=Xc9Ty1zcYLQJccRvGa1fYnCirbveO4xtYZqe7KJL5fVsXWMck/KF8tU80yHWg/vJCk vCjWa6IeKY8tQFUS//c7yrme/IGScea+ZVrXmcEAJZ/hhbqO9NcB7IphH+L97gDyi5ep 1TT+oflohBstIvEa9PFx/ilMMN19zK9ktISdFajC2bslvXI9VE55LGXnMw1p4WscoW/D bAn84eEXcvuBnSC8acHw9Y5ean1f1Wj3THw6IDq18R/WhLPYNhI/aRSDhaZuNJDwtql+ ZBQQGYJPSPTtAznVmpmiemXDoZM+xVd3E0YRz1pRf9GOERs8xhFBzJfFyouf3t3NiMBm GtqQ== 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=Wv0wC0Y2nMa7sKfq74YthnNcLgGAK5vR9W3+DouTvpU=; b=q+l0ZX/c74lpZ43gTIhpbVSmktPwU7ojZf5qRQLWWqP5ekBcvgeHWSvshWS8s8kSDg fboadoyB4ie/FJECblX4cPYYlz5oGap8YeyR618BofUStmyimaTFMCjYoo9k/5qa2J2K Z7sUY2bh83WFOjh4rdoknZ77UDwGXKTsMhLgvEANplygRCMAYM4kHgXSxJfWzZPmNtOt IW1xRT3Y1qtQxsBThehxOGNfPOaC1Z+AZBE7TyHwo8WPp+92Bk3UZQOdEzczVoUBFIY6 xlg2M0iQVdyn2ASaM/USIExxtXtEs8wGt/JS5x86py/v4WPDvVfOSYXZz3Ers08wFV9W /wTw== X-Gm-Message-State: AOAM530lNM10LZLcjikgEfJcj6zfpxa/DwqPq498p+YQpnK6QpaVzcAY Az2dnY/xsoAugx1Ihfhc9M5g8OSzGNg= X-Google-Smtp-Source: ABdhPJxOPwJFptV34YxlBVpHwX1sGAdDBwVPZhe4Pz9PvC7uCU4q8YqYKW9GrCGVzK+aIf/1DYsoUw== X-Received: by 2002:a17:90a:6842:: with SMTP id e2mr3190781pjm.190.1610437261884; Mon, 11 Jan 2021 23:41:01 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:01 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 06/11] xfs: Check for extent overflow when adding/removing dir entries Date: Tue, 12 Jan 2021 13:10:22 +0530 Message-Id: <20210112074027.10311-7-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when adding/removing directory entries. Signed-off-by: Chandan Babu R --- tests/xfs/526 | 186 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/526.out | 17 +++++ tests/xfs/group | 1 + 3 files changed, 204 insertions(+) create mode 100755 tests/xfs/526 create mode 100644 tests/xfs/526.out diff --git a/tests/xfs/526 b/tests/xfs/526 new file mode 100755 index 00000000..5a789d61 --- /dev/null +++ b/tests/xfs/526 @@ -0,0 +1,186 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 526 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# adding/removing directory entries. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject +. ./common/populate + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_debug +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "reduce_max_iextents" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +_scratch_mkfs_sized $((1024 * 1024 * 1024)) | _filter_mkfs >> $seqres.full 2> $tmp.mkfs +. $tmp.mkfs + +# Filesystems with directory block size greater than one FSB will not be tested, +# since "7 (i.e. XFS_DA_NODE_MAXDEPTH + 1 data block + 1 free block) * 2 (fsb +# count) = 14" is greater than the pseudo max extent count limit of 10. +# Extending the pseudo max limit won't help either. Consider the case where 1 +# FSB is 1k in size and 1 dir block is 64k in size (i.e. fsb count = 64). In +# this case, the pseudo max limit has to be greater than 7 * 64 = 448 extents. +if (( $dbsize != $dirbsize )); then + _notrun "FSB size ($dbsize) and directory block size ($dirbsize) do not match" +fi + +echo "Format and mount fs" +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +echo "Consume free space" +fillerdir=$SCRATCH_MNT/fillerdir +nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((dbsize * nr_free_blks)) $fillerdir $dbsize 0 >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +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 + +dent_len=255 + +echo "* Create directory entries" + +testdir=$SCRATCH_MNT/testdir +mkdir $testdir + +nr_dents=$((dbsize * 20 / dent_len)) +for i in $(seq 1 $nr_dents); do + dentry="$(printf "%0255d" $i)" + touch ${testdir}/$dentry >> $seqres.full 2>&1 || break +done + +echo "Verify directory's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $testdir | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm -rf $testdir + +echo "* Rename: Populate destination directory" + +dstdir=$SCRATCH_MNT/dstdir +mkdir $dstdir + +nr_dents=$((dirbsize * 20 / dent_len)) + +echo "Populate \$dstdir by moving new directory entries" +for i in $(seq 1 $nr_dents); do + dentry="$(printf "%0255d" $i)" + dentry=${SCRATCH_MNT}/${dentry} + touch $dentry || break + mv $dentry $dstdir >> $seqres.full 2>&1 || break +done + +rm $dentry + +echo "Verify \$dstdir's extent count" + +nextents=$($XFS_IO_PROG -c 'stat' $dstdir | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm -rf $dstdir + +echo "* Create multiple hard links to a single file" + +testdir=$SCRATCH_MNT/testdir +mkdir $testdir + +testfile=$SCRATCH_MNT/testfile +touch $testfile + +nr_dents=$((dirbsize * 20 / dent_len)) + +echo "Create multiple hardlinks" +for i in $(seq 1 $nr_dents); do + dentry="$(printf "%0255d" $i)" + ln $testfile ${testdir}/${dentry} >> $seqres.full 2>&1 || break +done + +rm $testfile + +echo "Verify directory's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $testdir | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm -rf $testdir + +echo "* Create multiple symbolic links to a single file" + +testdir=$SCRATCH_MNT/testdir +mkdir $testdir + +testfile=$SCRATCH_MNT/testfile +touch $testfile + +nr_dents=$((dirbsize * 20 / dent_len)) + +echo "Create multiple symbolic links" +for i in $(seq 1 $nr_dents); do + dentry="$(printf "%0255d" $i)" + ln -s $testfile ${testdir}/${dentry} >> $seqres.full 2>&1 || break; +done + +rm $testfile + +echo "Verify directory's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $testdir | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm -rf $testdir + +# success, all done +status=0 +exit diff --git a/tests/xfs/526.out b/tests/xfs/526.out new file mode 100644 index 00000000..d055f56d --- /dev/null +++ b/tests/xfs/526.out @@ -0,0 +1,17 @@ +QA output created by 526 +Format and mount fs +Consume free space +Create fragmented filesystem +Inject reduce_max_iextents error tag +Inject bmap_alloc_minlen_extent error tag +* Create directory entries +Verify directory's extent count +* Rename: Populate destination directory +Populate $dstdir by moving new directory entries +Verify $dstdir's extent count +* Create multiple hard links to a single file +Create multiple hardlinks +Verify directory's extent count +* Create multiple symbolic links to a single file +Create multiple symbolic links +Verify directory's extent count diff --git a/tests/xfs/group b/tests/xfs/group index bfaac6aa..0e98d623 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -523,6 +523,7 @@ 523 auto quick realtime growfs 524 auto quick punch zero insert collapse 525 auto quick attr +526 auto quick dir hardlink symlink 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:23 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: 12012583 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=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 13EAFC4332B for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D26FB22DFA for ; Tue, 12 Jan 2021 07:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728520AbhALHmM (ORCPT ); Tue, 12 Jan 2021 02:42:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387522AbhALHmL (ORCPT ); Tue, 12 Jan 2021 02:42:11 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4B73C0617A6; Mon, 11 Jan 2021 23:41:04 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id j1so963952pld.3; Mon, 11 Jan 2021 23:41:04 -0800 (PST) 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=vfcHfUVSSoz92RXngnOC7EatAp4YfY5+S3rf8SFIR2A=; b=iU4vZ5sfkA+BbSFuJKI53TCJHJOnn5Vjmc1/qQvEMjeKIRawhqslQ3uHS2hREjUqNB XBVShY9qkKlodUpPFdWk3ta8KSe7g15A1qjdXel/+zbcYusasOnjmsR+E5vHE1WRytiX +BRpTFsRuvGBcBKtN7CNjylJmZ2wZzmSdb1J5fyVObSbPuhgOIZbaHZ55yqLE8x4TIVh 38OrbO8yMSOKd/gju0+qUfqQ41J5tYMFY3HGxEtn8YpJHKq0Upw1UvlEnjWHhyeMFMBA mUixGAw573nuZdki2t/20BGuhMDEFSXTNu+jCyUc26Msv9JVUjeL9Ce4clA8IRUr0BZq ceoA== 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=vfcHfUVSSoz92RXngnOC7EatAp4YfY5+S3rf8SFIR2A=; b=awNBviaplwnlAkhYEpFc/k3aUaR89VohbXexHyhmKQGKkQnGRsGxqPxPe73mvbj69E S6NZbYrJnR3fwAjI/tKkz36K6IRYP4JaM8nRwWPNYiBLqlopeKGbBQmRWepQ7Dwddl1f rhbpZXLGUqe7DTPAcJNp18hZ8KmaeecGHsqjuZlqpf0nblCj3mUQYdLUTOC/gBBhhbvS xVDDRe/poJkzLWLcyWQEzRtsTrlLvavzbh0kOq19qAPj7tZaBIRMOufbp2v76UXBpbmn hcaIYSVSrFJFRYuVzEgcQhoZr+qh4P1NsLAl3NUwboKZl1cEJ+jSlbDh3KUmf7gXCan/ B0Aw== X-Gm-Message-State: AOAM530mZEP/MntL4Nb1xmmArPIkc5aYhSab2gHD9VVbujXdH6qttqLS 2iXXQXyZDaedjiydmzcFfD5bKFBUtPw= X-Google-Smtp-Source: ABdhPJx9n90fsIe9F2vkkqBJun7C0dvuoGv7ZVjuAbDjMchLY4mCz8dmEtq8VLjhvMfpFJZKr16cog== X-Received: by 2002:a17:90a:cb0b:: with SMTP id z11mr3148560pjt.101.1610437264230; Mon, 11 Jan 2021 23:41:04 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:03 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 07/11] xfs: Check for extent overflow when writing to unwritten extent Date: Tue, 12 Jan 2021 13:10:23 +0530 Message-Id: <20210112074027.10311-8-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when writing to an unwritten extent. Signed-off-by: Chandan Babu R --- tests/xfs/527 | 89 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/527.out | 11 ++++++ tests/xfs/group | 1 + 3 files changed, 101 insertions(+) create mode 100755 tests/xfs/527 create mode 100644 tests/xfs/527.out diff --git a/tests/xfs/527 b/tests/xfs/527 new file mode 100755 index 00000000..cd67bce4 --- /dev/null +++ b/tests/xfs/527 @@ -0,0 +1,89 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 527 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# writing to an unwritten extent. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_debug +_require_xfs_io_command "falloc" +_require_xfs_io_error_injection "reduce_max_iextents" + +echo "Format and mount fs" +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +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 + echo "* $io write to unwritten extent" + + echo "Fallocate $nr_blks blocks" + $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * bsize))" $testfile >> $seqres.full + + if [[ $io == "Buffered" ]]; then + xfs_io_flag="" + else + xfs_io_flag="-d" + fi + + 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" \ + $testfile >> $seqres.full 2>&1 + [[ $? != 0 ]] && break + done + + echo "Verify \$testfile's extent count" + nextents=$($XFS_IO_PROG -c 'stat' $testfile | grep nextents) + nextents=${nextents##fsxattr.nextents = } + if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 + fi + + rm $testfile +done + +# super_block->s_wb_err will have a newer seq value when compared to "/"'s +# file->f_sb_err. Consume it here so that xfs_scrub can does not error out. +$XFS_IO_PROG -c syncfs $SCRATCH_MNT >> $seqres.full 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/527.out b/tests/xfs/527.out new file mode 100644 index 00000000..3597ad92 --- /dev/null +++ b/tests/xfs/527.out @@ -0,0 +1,11 @@ +QA output created by 527 +Format and mount fs +Inject reduce_max_iextents error tag +* Buffered write to unwritten extent +Fallocate 15 blocks +Buffered write to every other block of fallocated space +Verify $testfile's extent count +* Direct write to unwritten extent +Fallocate 15 blocks +Direct write to every other block of fallocated space +Verify $testfile's extent count diff --git a/tests/xfs/group b/tests/xfs/group index 0e98d623..c17bc140 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -524,6 +524,7 @@ 524 auto quick punch zero insert collapse 525 auto quick attr 526 auto quick dir hardlink symlink +527 auto quick 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:24 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: 12012589 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 DF39CC43219 for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B21BD22E01 for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392021AbhALHmO (ORCPT ); Tue, 12 Jan 2021 02:42:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387522AbhALHmN (ORCPT ); Tue, 12 Jan 2021 02:42:13 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35465C0617A7; Mon, 11 Jan 2021 23:41:07 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id j1so963994pld.3; Mon, 11 Jan 2021 23:41:07 -0800 (PST) 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=pXq1swQ3X8lKmN4LLR69V2aKz/5fowFJPyMsr2Quw6Q=; b=m4zJTmbbQxLA46hY2pjRPl7hBLdOST7F3qMAnB6HPUC47NapVw7Vh6fR4H7xYfjhmJ 3y0Vm9pwERM7mgMj2RcKWxM7OCv0KsS1FyGnRJAWgcvfQh9Ft4Umx8mmKxHyagWN5lqb iPd5Qaojo9g9cFPrsD4HMDPX1QEPeJEjdM1jhuOoS+RF5yoUmLkj0OpGmVIz/trAD3Zv WscBoIGFOPY5gNiNtyqCKUTl+4QmPYlST4RllhQGfsxKPjANfWzMrP8FUiEQQUqIyCF7 nxDCHBif6dlxLh6srl6OUeoNltZM+/t6QMxFGL8WiCcJAxxNg/mejKT29fHVqQI26rcf UMIg== 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=pXq1swQ3X8lKmN4LLR69V2aKz/5fowFJPyMsr2Quw6Q=; b=rhVr2+c4knSl5zXxenq7+3uALQtyXbqzrLBCPn8Dpn9TSpojeRtMulcEhfMHJCaJJ6 m35n1J9OqVr+jbAXEB9MnucsWvTMufZXV/ofIvd4dRx+JL/5lfaxqalJrMNX1oeez/Yh b75JMy5Eb0XRnTY2VTT73jqU5bn8c/Gi/jnCaz8IqYIG+3XreYwLZsRSgS9Bzgh/g5ay 4kipaAgaDQ2OGXGi5vUn8H3bqJTk2EJrlNhkhXiK0I/dqjBsRZRpt54fTXm34ulIcL48 NWWLsw46+PhjmFAYhN+fc/TpRT9tL+JV9IEhPczYVc/WywJ1hBLI7fLGjw1IzFJry+Xu Z9Iw== X-Gm-Message-State: AOAM532bZZwYjBjaiBzPa5wF91R9EjylWZioYefPaVDtOCyCoxdsnsIC e+Fc2ouIsDPPi8HDNdbCJXtJwZ4oKuo= X-Google-Smtp-Source: ABdhPJzLjXicNNFH7JqpItiuB2vsPsDxfznmbw8kW/Yz/eBazXSq5lIGI0AzNj329i4Q8i1ACMhTww== X-Received: by 2002:a17:902:7b98:b029:db:fab3:e74b with SMTP id w24-20020a1709027b98b02900dbfab3e74bmr3495420pll.27.1610437266610; Mon, 11 Jan 2021 23:41:06 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:06 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 08/11] xfs: Check for extent overflow when moving extent from cow to data fork Date: Tue, 12 Jan 2021 13:10:24 +0530 Message-Id: <20210112074027.10311-9-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when writing to/funshare-ing a shared extent. Signed-off-by: Chandan Babu R --- tests/xfs/528 | 110 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/528.out | 12 +++++ tests/xfs/group | 1 + 3 files changed, 123 insertions(+) create mode 100755 tests/xfs/528 create mode 100644 tests/xfs/528.out diff --git a/tests/xfs/528 b/tests/xfs/528 new file mode 100755 index 00000000..269d368d --- /dev/null +++ b/tests/xfs/528 @@ -0,0 +1,110 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 528 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# writing to a shared extent. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/inject + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_scratch_reflink +_require_xfs_debug +_require_xfs_io_command "reflink" +_require_xfs_io_command "funshare" +_require_xfs_io_error_injection "reduce_max_iextents" + +echo "Format and mount fs" +_scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_block_size $SCRATCH_MNT) + +nr_blks=15 + +srcfile=${SCRATCH_MNT}/srcfile +dstfile=${SCRATCH_MNT}/dstfile + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + +echo "Create a \$srcfile having an extent of length $nr_blks blocks" +$XFS_IO_PROG -f -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \ + -c fsync $srcfile >> $seqres.full + +echo "* Write to shared extent" + +echo "Share the extent with \$dstfile" +$XFS_IO_PROG -f -c "reflink $srcfile" $dstfile >> $seqres.full + +echo "Buffered write to every other block of \$dstfile's shared extent" +for i in $(seq 1 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -s -c "pwrite $((i * bsize)) $bsize" $dstfile \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$dstfile's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $dstfile | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +rm $dstfile + +echo "* Funshare shared extent" + +echo "Share the extent with \$dstfile" +$XFS_IO_PROG -f -c "reflink $srcfile" $dstfile >> $seqres.full + +echo "Funshare every other block of \$dstfile's shared extent" +for i in $(seq 1 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -s -c "funshare $((i * bsize)) $bsize" $dstfile \ + >> $seqres.full 2>&1 + [[ $? != 0 ]] && break +done + +echo "Verify \$dstfile's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $dstfile | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +# super_block->s_wb_err will have a newer seq value when compared to "/"'s +# file->f_sb_err. Consume it here so that xfs_scrub can does not error out. +$XFS_IO_PROG -c syncfs $SCRATCH_MNT >> $seqres.full 2>&1 + +# success, all done +status=0 +exit + diff --git a/tests/xfs/528.out b/tests/xfs/528.out new file mode 100644 index 00000000..d0f2c878 --- /dev/null +++ b/tests/xfs/528.out @@ -0,0 +1,12 @@ +QA output created by 528 +Format and mount fs +Inject reduce_max_iextents error tag +Create a $srcfile having an extent of length 15 blocks +* Write to shared extent +Share the extent with $dstfile +Buffered write to every other block of $dstfile's shared extent +Verify $dstfile's extent count +* Funshare shared extent +Share the extent with $dstfile +Funshare every other block of $dstfile's shared extent +Verify $dstfile's extent count diff --git a/tests/xfs/group b/tests/xfs/group index c17bc140..ea892308 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -525,6 +525,7 @@ 525 auto quick attr 526 auto quick dir hardlink symlink 527 auto quick +528 auto quick reflink 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:25 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: 12012587 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 BBE41C432C3 for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8413922DFA for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391993AbhALHmN (ORCPT ); Tue, 12 Jan 2021 02:42:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391988AbhALHmN (ORCPT ); Tue, 12 Jan 2021 02:42:13 -0500 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81ABCC0617A9; Mon, 11 Jan 2021 23:41:09 -0800 (PST) Received: by mail-pl1-x631.google.com with SMTP id d4so142848plh.5; Mon, 11 Jan 2021 23:41:09 -0800 (PST) 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=i+DjE1xlEGRuZgveocTfgsgzOpdaBbBaWwg71VYt1cU=; b=XYA1shr41n4lYlHAk4YlodFDXvtHdMDJZGuYQ2FHYmeoYu3XtniQW9PaVzFF5lM67p IgjxTYJmWCJ9eI0VYHcL5jwKfANSSKjLEJ88mZrqJVKgfnQa7GwoCK6f7ihvdxujvY0z 11w8eX7MWwnycFZLAqLXzJwICSmdBqYFl+/SjqMNqU4DPFmoeFv8Gvw4G3q90Lat3HS6 iBSHv2NQCvVCJYEu6r5I9JgcJdHCT7gBDhiL5qcMqYmJOdFkO4zGr0Z7rE1p0wYBvzyj Yld8ZJVrrhUOAXp46G6BvpfFWbllab8tQ6Qshezgo2ydHNQcdIwwTD8nDy00kinIP2fk yhuQ== 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=i+DjE1xlEGRuZgveocTfgsgzOpdaBbBaWwg71VYt1cU=; b=G4v8n8IALp0DoMjHQZCRhwIxIdYs9sN/TEqhQQaW2DUWRIV7y+z8t1mTWlMIk+Fgt0 3cWMVay33j1ETHreWOpuxEOHuEotVFZGg/FjeX8P+q0C5oQS9lXshYpYcWKJwzu23Mst pQrCOmmvnKPPJCeNmRxyUxqho+ykJ5dy04qVwMi0KYpete7d+BhdW9C/WWi5S9fg0i5F P1yjNQ/5WmYItHvQ0YKxclyYFT0L61uIFgqW21rrYnzaGhGGSMwiAVtAM4rsBtWesyJ5 hXIYVWSQsURXOpVcgCBgj1KaLDESzbqo/IN7KDoASiIYmbGrMY0gL8FRUUz/9A4QGrm3 bg/g== X-Gm-Message-State: AOAM5329V57PW6wOcoHgDpisySv4gyUhV0y/Duim8V/7Ydf/sND2iRxS yysdi5yiHLybaA8a7n49tSrdn2pe2g0= X-Google-Smtp-Source: ABdhPJyGmy0oab9b05z49ZGFDiG8zLz59AxJ4lQLknYlpzRXPoE+ZLwbLjaw0UyFdkiJWioXRmKrAg== X-Received: by 2002:a17:903:22c9:b029:dc:9b7f:bd13 with SMTP id y9-20020a17090322c9b02900dc9b7fbd13mr3891642plg.67.1610437268922; Mon, 11 Jan 2021 23:41:08 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:08 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 09/11] xfs: Check for extent overflow when remapping an extent Date: Tue, 12 Jan 2021 13:10:25 +0530 Message-Id: <20210112074027.10311-10-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when remapping extents from one file's inode fork to another. Signed-off-by: Chandan Babu R --- tests/xfs/529 | 82 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/529.out | 8 +++++ tests/xfs/group | 1 + 3 files changed, 91 insertions(+) create mode 100755 tests/xfs/529 create mode 100644 tests/xfs/529.out diff --git a/tests/xfs/529 b/tests/xfs/529 new file mode 100755 index 00000000..f6a5922f --- /dev/null +++ b/tests/xfs/529 @@ -0,0 +1,82 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 529 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# remapping extents from one file's inode fork to another. +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/reflink +. ./common/inject + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_scratch_reflink +_require_xfs_debug +_require_xfs_io_command "reflink" +_require_xfs_io_error_injection "reduce_max_iextents" + +echo "* Reflink remap extents" + +echo "Format and mount fs" +_scratch_mkfs >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_block_size $SCRATCH_MNT) + +srcfile=${SCRATCH_MNT}/srcfile +dstfile=${SCRATCH_MNT}/dstfile + +nr_blks=15 + +echo "Create \$srcfile having an extent of length $nr_blks blocks" +$XFS_IO_PROG -f -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \ + -c fsync $srcfile >> $seqres.full + +echo "Create \$dstfile having an extent of length $nr_blks blocks" +$XFS_IO_PROG -f -c "pwrite -b $((nr_blks * bsize)) 0 $((nr_blks * bsize))" \ + -c fsync $dstfile >> $seqres.full + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + +echo "Reflink every other block from \$srcfile into \$dstfile" +for i in $(seq 1 2 $((nr_blks - 1))); do + $XFS_IO_PROG -f -c "reflink $srcfile $((i * bsize)) $((i * bsize)) $bsize" \ + $dstfile >> $seqres.full 2>&1 +done + +echo "Verify \$dstfile's extent count" +nextents=$($XFS_IO_PROG -c 'stat' $dstfile | grep nextents) +nextents=${nextents##fsxattr.nextents = } +if (( $nextents > 10 )); then + echo "Extent count overflow check failed: nextents = $nextents" + exit 1 +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/529.out b/tests/xfs/529.out new file mode 100644 index 00000000..687a8bd2 --- /dev/null +++ b/tests/xfs/529.out @@ -0,0 +1,8 @@ +QA output created by 529 +* Reflink remap extents +Format and mount fs +Create $srcfile having an extent of length 15 blocks +Create $dstfile having an extent of length 15 blocks +Inject reduce_max_iextents error tag +Reflink every other block from $srcfile into $dstfile +Verify $dstfile's extent count diff --git a/tests/xfs/group b/tests/xfs/group index ea892308..96e40901 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -526,6 +526,7 @@ 526 auto quick dir hardlink symlink 527 auto quick 528 auto quick reflink +529 auto quick reflink 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:26 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: 12012593 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 9DB63C43603 for ; Tue, 12 Jan 2021 07:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 47018230F9 for ; Tue, 12 Jan 2021 07:42:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392037AbhALHmQ (ORCPT ); Tue, 12 Jan 2021 02:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387522AbhALHmQ (ORCPT ); Tue, 12 Jan 2021 02:42:16 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0887C0617AA; Mon, 11 Jan 2021 23:41:11 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id m5so1119399pjv.5; Mon, 11 Jan 2021 23:41:11 -0800 (PST) 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=cfGsCj6MkXBBxVARbxSja/PAQC29R0bS584DXGVe8lk=; b=SQsZBWrMsXPsn9bdBtcgA8Um5ZaBFRCXxAJbHTHqdMve7ZN0V6I7vOheAF6onIX+lK mLlRaP+koyOZUiEIJvwTNYBj/YcFsFZMDcE3D9tXueHmiRgGcAgZWdXPoQO1a/ZQMLG+ 3toIFYo2iQZqs9JWr7YQn07JrxNNAnnGyJhNcRKoK7buyASu7iFnZTID/za6vMdJu5kc LPe/masb7vcdbQWd3wUe6gyXGxGBlBy0j3PFSceIRe+tYnyIICJ+BmZPdmfWDDzJ9dJq 6oyZAmMp6hqZoD2JOqjVCIKR4nZyQUcTJSsKY7TwPggHQSs9TwdEADSbu4GdMf9JSfvn ohMw== 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=cfGsCj6MkXBBxVARbxSja/PAQC29R0bS584DXGVe8lk=; b=NYNAStftYKG1ePzF0r5j52IL4qxc6akAi7S+fvtkBkyXwZzJsZIcrazTrxwmnWfYaF B8REkiQfs44secEz1WLsllvuN3CjmfaxqdCoHnYxA/Q3NzL1DoQBdLeyAXhqHs65nmIt VmyZzzvcpR5cUjheHmzIAAcBlpneXVtrGvpYY8FkgsAZh5VIUAc8V6l3I6bJeGmHf72U scwXtrfYE/RxyrZerHdDy8tFfjVdukTyd3j9xazVSkJVH7UnmGW8gm8y+okg3qmyUQjD ALNiBexFRrwWiHAbMnY4mRSnIfjQdMWpKcLG8k6Azqa4rvIcEDrT8Be6b0Boi90GIjR0 7YeA== X-Gm-Message-State: AOAM531xiIFsvW9QCmOlt6Fpiaih0GOzMu8r+nwtx81eMgz59n9tL1Wc YDGUlzkHKRc9jUzft7Db5zpou5mMsiY= X-Google-Smtp-Source: ABdhPJxp3v1CeWqPBA9ogNx2zCpuP5gnt5cQAeVGKkHRSNoCG/WXKhwC3slaiH2xTG/Oee7AFJboSA== X-Received: by 2002:a17:902:fe87:b029:da:5d3b:4a84 with SMTP id x7-20020a170902fe87b02900da5d3b4a84mr3994491plm.51.1610437271285; Mon, 11 Jan 2021 23:41:11 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:10 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 10/11] xfs: Check for extent overflow when swapping extents Date: Tue, 12 Jan 2021 13:10:26 +0530 Message-Id: <20210112074027.10311-11-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This test verifies that XFS does not cause inode fork's extent count to overflow when swapping forks across two files. Signed-off-by: Chandan Babu R --- tests/xfs/530 | 109 ++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/530.out | 13 ++++++ tests/xfs/group | 1 + 3 files changed, 123 insertions(+) create mode 100755 tests/xfs/530 create mode 100644 tests/xfs/530.out diff --git a/tests/xfs/530 b/tests/xfs/530 new file mode 100755 index 00000000..0986d8bf --- /dev/null +++ b/tests/xfs/530 @@ -0,0 +1,109 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 530 +# +# Verify that XFS does not cause inode fork's extent count to overflow when +# swapping forks between files +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_debug +_require_xfs_scratch_rmapbt +_require_xfs_io_command "fcollapse" +_require_xfs_io_command "swapext" +_require_xfs_io_error_injection "reduce_max_iextents" + +echo "* Swap extent forks" + +echo "Format and mount fs" +_scratch_mkfs >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_block_size $SCRATCH_MNT) + +srcfile=${SCRATCH_MNT}/srcfile +donorfile=${SCRATCH_MNT}/donorfile + +echo "Create \$donorfile having an extent of length 67 blocks" +$XFS_IO_PROG -f -s -c "pwrite -b $((17 * bsize)) 0 $((17 * bsize))" $donorfile \ + >> $seqres.full + +# After the for loop the donor file will have the following extent layout +# | 0-4 | 5 | 6 | 7 | 8 | 9 | 10 | +echo "Fragment \$donorfile" +for i in $(seq 5 10); do + start_offset=$((i * bsize)) + $XFS_IO_PROG -f -c "fcollapse $start_offset $bsize" $donorfile >> $seqres.full +done + +echo "Create \$srcfile having an extent of length 18 blocks" +$XFS_IO_PROG -f -s -c "pwrite -b $((18 * bsize)) 0 $((18 * bsize))" $srcfile \ + >> $seqres.full + +echo "Fragment \$srcfile" +# After the for loop the src file will have the following extent layout +# | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7-10 | +for i in $(seq 1 7); do + start_offset=$((i * bsize)) + $XFS_IO_PROG -f -c "fcollapse $start_offset $bsize" $srcfile >> $seqres.full +done + +echo "Collect \$donorfile's extent count" +donor_nr_exts=$($XFS_IO_PROG -c 'stat' $donorfile | grep nextents) +donor_nr_exts=${donor_nr_exts##fsxattr.nextents = } + +echo "Collect \$srcfile's extent count" +src_nr_exts=$($XFS_IO_PROG -c 'stat' $srcfile | grep nextents) +src_nr_exts=${src_nr_exts##fsxattr.nextents = } + +echo "Inject reduce_max_iextents error tag" +_scratch_inject_error reduce_max_iextents 1 + +echo "Swap \$srcfile's and \$donorfile's extent forks" +$XFS_IO_PROG -f -c "swapext $donorfile" $srcfile >> $seqres.full 2>&1 + +echo "Check for \$donorfile's extent count overflow" +nextents=$($XFS_IO_PROG -c 'stat' $donorfile | grep nextents) +nextents=${nextents##fsxattr.nextents = } + +if (( $nextents == $src_nr_exts )); then + echo "\$donorfile: Extent count overflow check failed" +fi + +echo "Check for \$srcfile's extent count overflow" +nextents=$($XFS_IO_PROG -c 'stat' $srcfile | grep nextents) +nextents=${nextents##fsxattr.nextents = } + +if (( $nextents == $donor_nr_exts )); then + echo "\$srcfile: Extent count overflow check failed" +fi + +# success, all done +status=0 +exit diff --git a/tests/xfs/530.out b/tests/xfs/530.out new file mode 100644 index 00000000..9f55608b --- /dev/null +++ b/tests/xfs/530.out @@ -0,0 +1,13 @@ +QA output created by 530 +* Swap extent forks +Format and mount fs +Create $donorfile having an extent of length 67 blocks +Fragment $donorfile +Create $srcfile having an extent of length 18 blocks +Fragment $srcfile +Collect $donorfile's extent count +Collect $srcfile's extent count +Inject reduce_max_iextents error tag +Swap $srcfile's and $donorfile's extent forks +Check for $donorfile's extent count overflow +Check for $srcfile's extent count overflow diff --git a/tests/xfs/group b/tests/xfs/group index 96e40901..289a082d 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -527,6 +527,7 @@ 527 auto quick 528 auto quick reflink 529 auto quick reflink +530 auto quick 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc From patchwork Tue Jan 12 07:40:27 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: 12012591 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 4385CC43217 for ; Tue, 12 Jan 2021 07:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 044DC22E01 for ; Tue, 12 Jan 2021 07:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392035AbhALHmQ (ORCPT ); Tue, 12 Jan 2021 02:42:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392022AbhALHmQ (ORCPT ); Tue, 12 Jan 2021 02:42:16 -0500 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 200B6C0617AB; Mon, 11 Jan 2021 23:41:14 -0800 (PST) Received: by mail-pg1-x52a.google.com with SMTP id c22so864308pgg.13; Mon, 11 Jan 2021 23:41:14 -0800 (PST) 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=vV7ogy9DCpvjr84rlrd0TpasCPPF/5GUSbpu487OVVk=; b=s8vZsOvVMKerawLCPqQGs2PlCzjQM4VeX7lm8dRY+bIDAQocei8ze6hTLJBcP1sXaM ezyAdpbUTPAXI7p6dysejWYbjzGBS2IUSB1c4H0AzDYCS3iJM5p5Ps8wQ9b7ISTOPVSH QSFPpKM9OlAF06yjXzoR4ClYXsCl296Vgt0/Mmg3iGhk+zz/2cvRlbRyo5wja+0Adcsu FtpyI3HapKACh0WMUyZEuyt679XJckt7DC5uGxicA30mDovNoB824DRAQoMLPfC7yo/F VfQeAhRz82982uMPc22upG4Ff0N2tEMNt4GnoQA+JUL89vUgDgdwQwFAwl3TPTJdqQfe rU0w== 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=vV7ogy9DCpvjr84rlrd0TpasCPPF/5GUSbpu487OVVk=; b=Q4S/cVbsRQYzndasMFwDz6SWPaIsr9BV/OfNiLYFqnb5LwVDbSAVveVIkbXix/6XkO 9VpbTzwldhgUeHm9g53vJ67SmQbP0+8MelPTWJzHT5wk1rLysQixjUDUK2Aov8llNbHR YhZY2/gRPN1t5rVVo+N7AvPBpuIhvPDe02c/0bA2BwAeAGbrBZ/bx1ZcA2gY/EuChZ6S rxHyTvoPmRPPk33EHiGu4NPQlvYz6aVOkHPy2Mws4SmFazDEjNEvca9fDhRUQTeceoK3 GejXgJIac6X5tc64Fac7lAwgcsg/IudWBlfUPeoBxIB6r9DSiF6OfFU2MsrRwNERHsuz xRGA== X-Gm-Message-State: AOAM5316U/N7U6NXWpe3rWHxB6nuAnL4HO/ohnSCMSKVR703JXd7p62O YBQfduLtJ6oIYtbllM2vJ44ESKcLHkc= X-Google-Smtp-Source: ABdhPJz7thilcvEEvy2xSDKmiVgmLPlgrLkjq4WN1RVuFPMjtTyl4kiR0Dq+ekbmD5e1eIOf5tKn7g== X-Received: by 2002:a63:101e:: with SMTP id f30mr3582264pgl.95.1610437273577; Mon, 11 Jan 2021 23:41:13 -0800 (PST) Received: from localhost.localdomain ([122.171.39.105]) by smtp.gmail.com with ESMTPSA id mj5sm1962340pjb.20.2021.01.11.23.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Jan 2021 23:41:13 -0800 (PST) From: Chandan Babu R To: fstests@vger.kernel.org Cc: Chandan Babu R , linux-xfs@vger.kernel.org, darrick.wong@oracle.com, djwong@kernel.org Subject: [PATCH V3 11/11] xfs: Stress test with bmap_alloc_minlen_extent error tag enabled Date: Tue, 12 Jan 2021 13:10:27 +0530 Message-Id: <20210112074027.10311-12-chandanrlinux@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210112074027.10311-1-chandanrlinux@gmail.com> References: <20210112074027.10311-1-chandanrlinux@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org This commit adds a stress test that executes fsstress with bmap_alloc_minlen_extent error tag enabled. Signed-off-by: Chandan Babu R --- tests/xfs/531 | 84 +++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/531.out | 7 ++++ tests/xfs/group | 1 + 3 files changed, 92 insertions(+) create mode 100755 tests/xfs/531 create mode 100644 tests/xfs/531.out diff --git a/tests/xfs/531 b/tests/xfs/531 new file mode 100755 index 00000000..fd92c3ea --- /dev/null +++ b/tests/xfs/531 @@ -0,0 +1,84 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2020 Chandan Babu R. All Rights Reserved. +# +# FS QA Test 531 +# +# Execute fsstress with bmap_alloc_minlen_extent error tag enabled. +# +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter +. ./common/inject +. ./common/populate + +# remove previous $seqres.full before test +rm -f $seqres.full + +# real QA test starts here + +_supported_fs xfs +_require_scratch +_require_xfs_debug +_require_test_program "punch-alternating" +_require_xfs_io_error_injection "bmap_alloc_minlen_extent" + +echo "Format and mount fs" +_scratch_mkfs_sized $((1024 * 1024 * 1024)) >> $seqres.full +_scratch_mount >> $seqres.full + +bsize=$(_get_file_block_size $SCRATCH_MNT) + +echo "Consume free space" +fillerdir=$SCRATCH_MNT/fillerdir +nr_free_blks=$(stat -f -c '%f' $SCRATCH_MNT) +nr_free_blks=$((nr_free_blks * 90 / 100)) + +_fill_fs $((bsize * nr_free_blks)) $fillerdir $bsize 0 >> $seqres.full 2>&1 + +echo "Create fragmented filesystem" +for dentry in $(ls -1 $fillerdir/); do + $here/src/punch-alternating $fillerdir/$dentry >> $seqres.full +done + +echo "Inject bmap_alloc_minlen_extent error tag" +_scratch_inject_error bmap_alloc_minlen_extent 1 + +echo "Scale fsstress args" +args=$(_scale_fsstress_args -p $((LOAD_FACTOR * 75)) -n $((TIME_FACTOR * 1000))) + +echo "Execute fsstress in background" +$FSSTRESS_PROG -d $SCRATCH_MNT $args \ + -f bulkstat=0 \ + -f bulkstat1=0 \ + -f fiemap=0 \ + -f getattr=0 \ + -f getdents=0 \ + -f getfattr=0 \ + -f listfattr=0 \ + -f mread=0 \ + -f read=0 \ + -f readlink=0 \ + -f readv=0 \ + -f stat=0 \ + -f aread=0 \ + -f dread=0 > /dev/null 2>&1 + +# success, all done +status=0 +exit diff --git a/tests/xfs/531.out b/tests/xfs/531.out new file mode 100644 index 00000000..67f40654 --- /dev/null +++ b/tests/xfs/531.out @@ -0,0 +1,7 @@ +QA output created by 531 +Format and mount fs +Consume free space +Create fragmented filesystem +Inject bmap_alloc_minlen_extent error tag +Scale fsstress args +Execute fsstress in background diff --git a/tests/xfs/group b/tests/xfs/group index 289a082d..f09c742b 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -528,6 +528,7 @@ 528 auto quick reflink 529 auto quick reflink 530 auto quick +531 auto stress 758 auto quick rw attr realtime 759 auto quick rw realtime 760 auto quick rw collapse punch insert zero prealloc