From patchwork Wed Jun 26 15:49:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2786781 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4FA6BC0AB1 for ; Wed, 26 Jun 2013 15:49:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 035C32051C for ; Wed, 26 Jun 2013 15:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0FE1204F2 for ; Wed, 26 Jun 2013 15:49:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751581Ab3FZPtc (ORCPT ); Wed, 26 Jun 2013 11:49:32 -0400 Received: from dkim1.fusionio.com ([66.114.96.53]:59492 "EHLO dkim1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347Ab3FZPtb (ORCPT ); Wed, 26 Jun 2013 11:49:31 -0400 Received: from mx2.fusionio.com (unknown [10.101.1.160]) by dkim1.fusionio.com (Postfix) with ESMTP id 652487C0423 for ; Wed, 26 Jun 2013 09:49:31 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1372261771; bh=S3YPdm4Qt3ctqi8iuP3z37w4kYLA2RFUphasTgT48WA=; h=From:To:Subject:Date; b=R73RDS4lsVytJoMz62CF7t/U9H1Lz1Y7ui9VdTRPQJLenPHP4lK2ERJnM7RYRWNIf Q47+pK5qQuuN23l3HKTH/OQbEbO1vjgFnDBIIZ/HSs1rDlQa0VC4DuciJX1D9/wM5a CZ7lP5rnhSRrUAt216ccXEuxZKXWqdEDz/ExMJic= X-ASG-Debug-ID: 1372261770-0421b5022188d10001-6jHSXT Received: from CAS2.int.fusionio.com (cas2.int.fusionio.com [10.101.1.41]) by mx2.fusionio.com with ESMTP id AsoAU8vxMdGuE8BC (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Wed, 26 Jun 2013 09:49:30 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (10.101.1.160) by mail.fusionio.com (10.101.1.41) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 26 Jun 2013 09:49:30 -0600 From: Josef Bacik To: , Subject: [PATCH] xfstests: check if the scratch dev pool is mounted in _require_scratch Date: Wed, 26 Jun 2013 11:49:28 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: check if the scratch dev pool is mounted in _require_scratch Message-ID: <1372261768-1795-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Originating-IP: [10.101.1.160] X-Barracuda-Connect: cas2.int.fusionio.com[10.101.1.41] X-Barracuda-Start-Time: 1372261770 X-Barracuda-Encrypted: AES128-SHA X-Barracuda-URL: http://10.101.1.181:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at fusionio.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global 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.135032 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=-8.1 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 If you use the SCRATCH_DEV_POOL for btrfs you will end up with the command line like this mkfs.btrfs $SCRATCH_DEV_POOL $SCRATCH_DEV and btrfs does this thing where it makes the lowest valued device id show up in /proc/mounts no matter which device you specify at the mount command. So in this case mount will show the first device in $SCRATCH_DEV_POOL instead of $SCRATCH_DEV, so anybody who wants to just use the scratch mnt with the scratch dev will fail to work because we never unmount the scratch mount. Fix this by checking to see if the scratch dev pool is mounted at scratch mnt and unmount it so we can run our test. This fixes the issue I was seeing by running ./check btrfs/307 generic/015 Thanks, Signed-off-by: Josef Bacik --- common/rc | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/common/rc b/common/rc index ad7cbc9..7e03400 100644 --- a/common/rc +++ b/common/rc @@ -938,6 +938,8 @@ _supported_os() # _require_scratch() { + local i + case "$FSTYP" in nfs*) echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1 @@ -978,6 +980,17 @@ _require_scratch() exit 1 fi fi + + # we may have a scratch dev pool specified, so make sure it's been unmounted + # from the scratch mount + for i in $SCRATCH_DEV_POOL; do + if _mount | grep $i | grep -q $SCRATCH_MNT; then + if ! $UMOUNT_PROG $i; then + echo "failed to umount $i - aborting" + exit 1 + fi + fi + done } # this test needs a logdev