From patchwork Mon Oct 21 15:53:16 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 3078711 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 696FA9F372 for ; Mon, 21 Oct 2013 15:53:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 381CA2030E for ; Mon, 21 Oct 2013 15:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13B3620306 for ; Mon, 21 Oct 2013 15:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753858Ab3JUPxX (ORCPT ); Mon, 21 Oct 2013 11:53:23 -0400 Received: from dkim1.fusionio.com ([66.114.96.53]:58834 "EHLO dkim1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847Ab3JUPxW (ORCPT ); Mon, 21 Oct 2013 11:53:22 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim1.fusionio.com (Postfix) with ESMTP id 3C5437C068F for ; Mon, 21 Oct 2013 09:53:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1382370802; bh=J1TkO8RTbp/eM06t+iGQ9YoR2PjJrfQIJM1tx0+3Yt8=; h=From:To:Subject:Date; b=bzcgnczw2zRUBzOm+/rDyOkAp/QGZdJ/Qa4W2B0lNFrqQJPZU1b7FoqOJrWaPmJD5 atzAr6D2XCdy9U/pVxS+hNpesY4oufnlPdMUtQ9w/MaSL4pmfLiULq9GvW3GroAHQ0 n96llVxi+wUnT7zS0Prr24e6SA5+Sb6xyf85EpKc= X-ASG-Debug-ID: 1382370801-03d6a51949164dd0001-6jHSXT Received: from CAS1.int.fusionio.com (cas1.int.fusionio.com [10.101.1.40]) by mx1.fusionio.com with ESMTP id pVxNVq5A4CcXLkKl (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Mon, 21 Oct 2013 09:53:21 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (10.101.1.160) by mail.fusionio.com (10.101.1.40) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 21 Oct 2013 09:53:17 -0600 From: Josef Bacik To: , Subject: [PATCH] xfstests: wipefs new device in btrfs/003 Date: Mon, 21 Oct 2013 11:53:16 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: wipefs new device in btrfs/003 Message-ID: <1382370796-12391-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas1.int.fusionio.com[10.101.1.40] X-Barracuda-Start-Time: 1382370801 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.180:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.141670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We changed btrfs device add to check and see if there is an existing fs on the device we are adding, so you now have to do -f if you want to do this. In order to get around checking to see if we have this version of btrfs-progs just wipefs the device we're adding to make sure the device add will pass no matter which version of btrfs-progs you have. Thanks, Signed-off-by: Josef Bacik Reviewed-by: Eric Sandeen --- common/config | 1 + tests/btrfs/003 | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/common/config b/common/config index 20c5b09..5dd7c7d 100644 --- a/common/config +++ b/common/config @@ -180,6 +180,7 @@ export E4DEFRAG_PROG="`set_prog_path e4defrag`" export LOGGER_PROG="`set_prog_path logger`" export DBENCH_PROG="`set_prog_path dbench`" export DMSETUP_PROG="`set_prog_path dmsetup`" +export WIPEFS_PROG="`set_prog_path wipefs`" # Generate a comparable xfsprogs version number in the form of # major * 10000 + minor * 100 + release diff --git a/tests/btrfs/003 b/tests/btrfs/003 index 15c2cc7..9105d06 100755 --- a/tests/btrfs/003 +++ b/tests/btrfs/003 @@ -51,6 +51,7 @@ _supported_os Linux _require_scratch _require_scratch_dev_pool _require_deletable_scratch_dev_pool +_require_command $WIPEFS_PROG rm -f $seqres.full @@ -109,6 +110,8 @@ _test_add() dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX` _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10 for i in `seq 2 $n`; do + $WIPEFS_PROG -a ${devs[$i]} >> $seqres.full 2>&1 || \ + _fail "wipefs failed" $BTRFS_UTIL_PROG device add ${devs[$i]} $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "device add failed" done $BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "balance failed" @@ -150,6 +153,7 @@ _test_replace() # add a new disk to btrfs ds=${devs[@]:$(($n)):1} + $WIPEFS_PROG -a ${ds} >> $seqres.full 2>&1 || _fail "wipefs failed" $BTRFS_UTIL_PROG device add ${ds} $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "dev add failed" # in some system balance fails if there is no delay (a bug) # putting sleep 10 to work around as of now