From patchwork Thu Feb 15 11:47:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13558242 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 817CF57872; Thu, 15 Feb 2024 11:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997633; cv=none; b=MIquC905qV1TsHazALfe0T51jyv5Yh5CcG8f7hfTbi6dj8V8tAd95lap80KRgepYSf8bs3Ea6dK0h7GRFe9YAd+UNoNXJjyZY8yPxeZb83OUBoZPj0YJWPtCQvtamAn9y7RvVPxTBL5FnvTI6kHqNUN7p7gJ6NqYLICvMX7vDqM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997633; c=relaxed/simple; bh=DHagoA8SxeV0zdtLBbp+ii5HURLfR7Zs9XqY6fKNRik=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=K9nYWVQ5uCVQ8omPIG5sOmnypRC3VZURN5WssXYwCXpHcCPkOAcD913DnGF+e7wL0BXZx1aheOZ2PwS1SpP2MM1rzuMLJVpcm0LVqh62BeQjjt+CI1v4C87U416KlMPu36TvXrrSGgcPQsKGFqBWiipOvmVeFospAyIW4RUvwnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=aQqfS5kK; arc=none smtp.client-ip=216.71.154.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="aQqfS5kK" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1707997631; x=1739533631; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=DHagoA8SxeV0zdtLBbp+ii5HURLfR7Zs9XqY6fKNRik=; b=aQqfS5kKyi6m7FGQyQ5kYPU9gcTTDR8Z8Y03BvX3ZnwnqZcjKSgJFaSg 05mNt9zKdys7FASsDf41kA5ATvoqNIO6vl10beaKA4/z0JrK2h5wuyfMK Ux4e2UA9NofKC8XDUz2y+WIRTiEy5GnO801KTqKArbc6X5epLKk7ogcgb vZWngyLDieDEAq4TfmsRbwC42JtW/EcFoxIaFB4+L5tJ/YCu7JVdVUc1v j30mFxig9ApGKhsHkZg2sWPjq4TWMek47/GdfWl65gOpSgN1abJ9GAR6a KYH/Ie0w+WEQI/+3Ahwi0/7lcTldl9bV2VE9WLqkaBgeTfBiBn9+8zV3s g==; X-CSE-ConnectionGUID: 8usngS0wTOGmcJihwIGnRQ== X-CSE-MsgGUID: WknTjTS1QiyGhHx5LLMDRg== X-IronPort-AV: E=Sophos;i="6.06,161,1705334400"; d="scan'208";a="8967196" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2024 19:47:10 +0800 IronPort-SDR: oed83op9MxeQp0xlzQOAL9xBWV/fNyP2PsbXx9N1gtKqgFkATz2KsQBcTNWCzurTcZH8AAeZ4r i26sF1rdwYGw== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 Feb 2024 02:56:44 -0800 IronPort-SDR: 51EBZHP2vdY1P9iiEyS46m5CkKlo9g2Se/y7xLOQ9cAqf4nHD9T155R10Pi/eQMUI0NVOEFFB3 eE0v3/+9fd2w== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Feb 2024 03:47:09 -0800 From: Johannes Thumshirn Date: Thu, 15 Feb 2024 03:47:04 -0800 Subject: [PATCH v3 1/3] filter.brtfs: add filter for conversion Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-balance-fix-v3-1-79df5d5a940f@wdc.com> References: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> In-Reply-To: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> To: Anand Jain Cc: Johannes Thumshirn , Zorro Lang , linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, fdmanana@suse.com X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707997627; l=728; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=DHagoA8SxeV0zdtLBbp+ii5HURLfR7Zs9XqY6fKNRik=; b=piMOqiexYFPPqFDJUCeTymh/WVHsZeKJaaIPWNUjauWnQ5zlzgKop7AdaIEj/g2ve55pD2tY2 vN2GhHdTBhLAh2dCsQn6tEGyhp7xV1DOsT+abYPVkLvERCpEE0Hl/J5 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Add a filter for the output of btrfs-balance with a convert argument. Signed-off-by: Johannes Thumshirn --- common/filter.btrfs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/filter.btrfs b/common/filter.btrfs index 8ab76fcb193a..ea76e7291108 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -141,5 +141,11 @@ _filter_stripe_tree() -e "s/bytes used [0-9]+/bytes used XXXXXX/" } +# filter output of "btrfs balance start -[smd] convert +_filter_balance_convert() +{ + _filter_scratch | \ + sed -e "s/relocate [0-9]\+ out of [0-9]\+ chunks/relocate X out of X chunks/g" +} # make sure this script returns success /bin/true From patchwork Thu Feb 15 11:47:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13558243 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 673D612AAF4; Thu, 15 Feb 2024 11:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997634; cv=none; b=t4K+a7ajaWA2C3vuvFeHJk5gUd+oOM5ff/6oS5pvbFvhDClzOf2844fGgaLb23fiRBBaLlvOss1sqOJs4bb7MEVNhcMZHMJa2cg05K7UeGDFWLwadkXM/VWhnbVZliGPCCP6FCXICOhwKwx2pgu/Y5JJ7aUGxNOFpMH+hF91nOw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997634; c=relaxed/simple; bh=YMPebLD6MMvH6YOxwWD2dlU27sq8q43dhhOqdaoKwJI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DOuzh9J87kqgpBq6Hev18aO8GFiPsZHwdzp5fBr2FAEWFppAHDWf9n8l4smI0WM8IFYGZCFceZXJBkN8cWA92EnGEoI3A3DuP7S2xjXFJ052EiaICxMKd5aN4zVwtdBUk6SvLQjPO/G953wG700djyMY8BK/eofyEXvSko8mdl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=e05V8upb; arc=none smtp.client-ip=216.71.154.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="e05V8upb" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1707997632; x=1739533632; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=YMPebLD6MMvH6YOxwWD2dlU27sq8q43dhhOqdaoKwJI=; b=e05V8upbTN6ce4Gnb4G8RN9UqBYnBlxn9zJXw3IlPHq/WnGyu75eqTIy cuwCMOM35JykTHKVSTsA8oRhfiuLkH1VysdfWurvl53VKyumVI+jXXaFs HNxi84LoGQeGJaeMDTAVc38V2eu7GyX8R0QzXlomM1EubRZo6SQ4T0UMP PHLcktbcBpYY4Mxu003ZlVWnLZwNc7HIdpm5KqvX9Jktn/Vwrw6Oz3rPU swisYDm2CUBcKOANWWFkEUgcwfampouHJMGjQ63ii12urB7EAuyPk5DcZ qG75SFLxuVMAdgEci6Qlb3zUwhyZ/9J96XN5nHOTGinsMb9Lq0rC+bSRV A==; X-CSE-ConnectionGUID: NAByAfOJQ6Wf5ftSjAiBfw== X-CSE-MsgGUID: ZXU2fwbvRNaaeT8BXeYY8g== X-IronPort-AV: E=Sophos;i="6.06,161,1705334400"; d="scan'208";a="8967200" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2024 19:47:11 +0800 IronPort-SDR: Vfs/peU3/GksZp/eFwGH/hYXPN/VyfyW/Wx2BlT2Qa3zD+2ArVr42XqSPXHrLYgNyw5JOR+zLj NRSRZ9SuzabA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 Feb 2024 02:56:45 -0800 IronPort-SDR: vYV5JL2MzQaXZTHmo0ak1RKYdXoUvSuOPQO5pcafvHm8LOxwrRMKrTRuwxmTfqR1CeoAxb2xzl NQ4T7I2HCBwA== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Feb 2024 03:47:10 -0800 From: Johannes Thumshirn Date: Thu, 15 Feb 2024 03:47:05 -0800 Subject: [PATCH v3 2/3] filter.btrfs: add filter for btrfs device add Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-balance-fix-v3-2-79df5d5a940f@wdc.com> References: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> In-Reply-To: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> To: Anand Jain Cc: Johannes Thumshirn , Zorro Lang , linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, fdmanana@suse.com X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707997627; l=796; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=YMPebLD6MMvH6YOxwWD2dlU27sq8q43dhhOqdaoKwJI=; b=NHwOg+0OhiLR/s6ALvd/8bsv42q4kY2cNW5F8979H1u2mVm4SLSZQ4j3y5yZyvH9E43GBT75+ qUnyeEHqFriCr5B3qooSfrzxqJz3DukdMn5hU586xFfqIAvvUsI/Mtb X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Add a filter for the output of btrfs device add. Signed-off-by: Johannes Thumshirn --- common/filter.btrfs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/filter.btrfs b/common/filter.btrfs index ea76e7291108..a1c3013ecb5d 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -147,5 +147,14 @@ _filter_balance_convert() _filter_scratch | \ sed -e "s/relocate [0-9]\+ out of [0-9]\+ chunks/relocate X out of X chunks/g" } + +# filter output of "btrfs device add" +_filter_device_add() +{ + _filter_scratch | _filter_scratch_pool | \ + sed -e "s/Resetting device zones SCRATCH_DEV ([0-9]\+/Resetting device zones SCRATCH_DEV (XXX/g" + +} + # make sure this script returns success /bin/true From patchwork Thu Feb 15 11:47:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13558244 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7ADAD12B144; Thu, 15 Feb 2024 11:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.71.154.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997635; cv=none; b=J8zDTsOj5lKAsKYZYSvoj7ESSHDfyaUwh2Xn+g7dFbRHahK/N6qthwYDmM4KSQjyvj5ArmHevb8mvNlsyY8gQ7CGLJpV39G128ImKPQCHFY4FlcfCNVnM/8AyBl2LiZiblHxtw1R+vSqli8DDJ7uDql9qc7ju7jjkmps7JJkAn4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707997635; c=relaxed/simple; bh=S+7EbsEyEm/QpVUEhRGu6+et5IyHnqN/50jaPSCcAMs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Prw5cNkKl/fg8+eiYlgTqPz+G5aRHOD03VH+kEhE585TV9jTVM3tjpc05pJuI0vfPgpLb9msyT9eLy+E54mqv9KF+8CwOiGbuld3bAmauNOapkt4ZuT+jbOTk+KItsxen/GvPhvgYNdp53ORBcYFNWl+e8rcclzYI68AjBKP9wM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com; spf=pass smtp.mailfrom=wdc.com; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b=rm6FZt1N; arc=none smtp.client-ip=216.71.154.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wdc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wdc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="rm6FZt1N" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1707997633; x=1739533633; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=S+7EbsEyEm/QpVUEhRGu6+et5IyHnqN/50jaPSCcAMs=; b=rm6FZt1NTxur8Z5Kz0Zi2xeEOpIwtF5ach/7DOPPvw67ykDQqaJyfzSx jzolD45x2iz5vJpUSaV2HhaLLu6JHfVtTxd2IuKVGUl+TRXySRUqo6OZk jBmSCO1P97TXsLjvk+V97e7EU3pO/03Vm2NYsRQHHK4Dcu2uAQ9RlWUER mm+EONPYxDoKS/v1D7D4lWWDbB6/00w+x83F0iCCN+NMl5PgPwbbCaNxo f3tQQIMCrqlrD6Ow0q5afycu8vb/TEcW6mUI5AIB+cUgAbhlmNnW9TJFE 1lLbUFY/opTxvZFYDQeDWamMW/ZGmB7dQjcYwpSyk/KKlJe+01T/XRvKq A==; X-CSE-ConnectionGUID: w82ys33XReaa4pWK9F+hEw== X-CSE-MsgGUID: 5gfgWBfPS3yb+YbNPkJTpQ== X-IronPort-AV: E=Sophos;i="6.06,161,1705334400"; d="scan'208";a="8967201" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 15 Feb 2024 19:47:12 +0800 IronPort-SDR: Pf+NC5xCZ2D73xArsp6B9kjsmgTqZUdZGFer1A4SN3eR9gtDRd8kxWE5w2GyP91IzrdZIWy1Gl co1YGWBg2yTA== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 15 Feb 2024 02:56:46 -0800 IronPort-SDR: 88AxqHl70/Lg0dx19tj2AaED0JikQJA+I1fOYxatWiWdSBNr+GyxIYWEVQoAMH8m5pULj+7IoU flFB5ElznpXQ== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 15 Feb 2024 03:47:11 -0800 From: Johannes Thumshirn Date: Thu, 15 Feb 2024 03:47:06 -0800 Subject: [PATCH v3 3/3] fstests: btrfs: check conversion of zoned fileystems Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240215-balance-fix-v3-3-79df5d5a940f@wdc.com> References: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> In-Reply-To: <20240215-balance-fix-v3-0-79df5d5a940f@wdc.com> To: Anand Jain Cc: Johannes Thumshirn , Zorro Lang , linux-btrfs@vger.kernel.org, fstests@vger.kernel.org, fdmanana@suse.com X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707997627; l=3493; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=S+7EbsEyEm/QpVUEhRGu6+et5IyHnqN/50jaPSCcAMs=; b=ojl1bD+HbpHb+0eCrmZHDkEMONAgnYfp25WCHBLqk6/1jf567FgHNn3Y482RfoU4uTmOeAs69 AEmyPQsNj/FCMR4KH8xpk2ExfOA8PfLIEtZqMRpSuwMOWMYMrWJrLb5 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Recently we had a bug where a zoned filesystem could be converted to a higher data redundancy profile than supported. Add a test-case to check the conversion on zoned filesystems. Reviewed-by: Filipe Manana Signed-off-by: Johannes Thumshirn --- tests/btrfs/310 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/310.out | 12 ++++++++++ 2 files changed, 79 insertions(+) diff --git a/tests/btrfs/310 b/tests/btrfs/310 new file mode 100755 index 000000000000..c39f60168f8a --- /dev/null +++ b/tests/btrfs/310 @@ -0,0 +1,67 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Western Digital Corporation. All Rights Reserved. +# +# FS QA Test 310 +# +# Test that btrfs convert can ony be run to convert to supported profiles on a +# zoned filesystem +# +. ./common/preamble +_begin_fstest volume raid convert + +_fixed_by_kernel_commit XXXXXXXXXX \ + "btrfs: zoned: don't skip block group profile checks on conv zones" + +. common/filter.btrfs + +_supported_fs btrfs +_require_scratch_dev_pool 4 +_require_zoned_device "$SCRATCH_DEV" + +devs=( $SCRATCH_DEV_POOL ) + +# Create and mount single device FS +_scratch_mkfs -msingle -dsingle 2>&1 > /dev/null +_scratch_mount + +# Convert FS to metadata/system DUP +_run_btrfs_balance_start -f -mconvert=dup -sconvert=dup $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert + +# Convert FS to data DUP, must fail +_run_btrfs_balance_start -dconvert=dup $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert + +# Add device +$BTRFS_UTIL_PROG device add ${devs[1]} $SCRATCH_MNT | _filter_device_add + +# Convert FS to data RAID1, must fail +_run_btrfs_balance_start -dconvert=raid1 $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert | head -1 + +# Convert FS to data RAID0, must fail +_run_btrfs_balance_start -dconvert=raid0 $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert | head -1 + +# Add device +$BTRFS_UTIL_PROG device add ${devs[2]} $SCRATCH_MNT | _filter_device_add + +# Convert FS to data RAID5, must fail +_run_btrfs_balance_start -f -dconvert=raid5 $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert | head -1 + +# Add device +$BTRFS_UTIL_PROG device add ${devs[3]} $SCRATCH_MNT | _filter_device_add + +# Convert FS to data RAID10, must fail +_run_btrfs_balance_start -dconvert=raid10 $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert | head -1 + +# Convert FS to data RAID6, must fail +_run_btrfs_balance_start -f -dconvert=raid6 $SCRATCH_MNT 2>&1 |\ + _filter_balance_convert | head -1 + +# success, all done +status=0 +exit diff --git a/tests/btrfs/310.out b/tests/btrfs/310.out new file mode 100644 index 000000000000..bc06b29ecf10 --- /dev/null +++ b/tests/btrfs/310.out @@ -0,0 +1,12 @@ +QA output created by 310 +Done, had to relocate X out of X chunks +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument +There may be more info in syslog - try dmesg | tail +Resetting device zones SCRATCH_DEV (XXX zones) ... +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument +Resetting device zones SCRATCH_DEV (XXX zones) ... +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument +Resetting device zones SCRATCH_DEV (XXX zones) ... +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument +ERROR: error during balancing 'SCRATCH_MNT': Invalid argument