From patchwork Fri May 3 20:11:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2519131 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1E65E3FD1A for ; Fri, 3 May 2013 20:11:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934197Ab3ECULj (ORCPT ); Fri, 3 May 2013 16:11:39 -0400 Received: from dkim1.fusionio.com ([66.114.96.53]:55333 "EHLO dkim1.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934180Ab3ECULi (ORCPT ); Fri, 3 May 2013 16:11:38 -0400 Received: from mx2.fusionio.com (unknown [10.101.1.160]) by dkim1.fusionio.com (Postfix) with ESMTP id 196157C041B for ; Fri, 3 May 2013 14:11:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1367611898; bh=IBMrD/CaxlxFqq5kMjx11mtUk+tZFdES9u8yft7hcWA=; h=From:To:Subject:Date; b=MoHXyspDHU4uWFCLb2J5ZX92XhSUaJYO4NzalA4LnUSY73g4tJhuicGse668tSuP5 AryBARnfyTGh9xRqJq9X4gwZrsiNa3hJNWo6myecuckcO2lcEesMgdY9I3FxPA49Uf sWUcnG7D/LQ/uA1NP0xCXgP4vmYmxECZgcqc8WBw= X-ASG-Debug-ID: 1367611897-0421b5368241890001-6jHSXT Received: from mail1.int.fusionio.com ([10.101.1.21]) by mx2.fusionio.com with ESMTP id WL8TX7f42H4R76mT (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Fri, 03 May 2013 14:11:37 -0600 (MDT) X-Barracuda-Envelope-From: JBacik@fusionio.com Received: from localhost (76.182.72.146) by mail.fusionio.com (10.101.1.19) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 3 May 2013 14:11:36 -0600 From: Josef Bacik To: , Subject: [PATCH] xfstests: unmount scratch mnt in test 307 Date: Fri, 3 May 2013 16:11:35 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: unmount scratch mnt in test 307 Message-ID: <1367611895-6852-1-git-send-email-jbacik@fusionio.com> X-Mailer: git-send-email 1.7.7.6 MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.101.1.21] X-Barracuda-Start-Time: 1367611897 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.129921 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 So if you have a mount command that doesn't use /etc/mtab then it will spit out a different device for the mounted device. So say we have SCRATCH_DEV_POOL="/dev/sda /dev/sdb /dev/sdc" we will turn this into SCRATCH_DEV="/dev/sda" SCRATCH_DEV_POOL="/dev/sdb /dev/sdc" and then when you mkfs this you do _scratch_mkfs $SCRATCH_DEV_POOL which turns into this mkfs.btrfs /dev/sdb /dev/sdc /dev/sda becuase we do mkfs $* $SCRATCH_DEV Then btrfs will always show the lowest devid in /proc/mounts to maintain consistency, so even though we do mount /dev/sda $SCRATCH_MNT, you will see /dev/sdb as the mounted device in /proc/mounts. So then say the next test wants to just use $SCRATCH_DEV, it will do _require_scratchdev which will check to see if $SCRATCH_DEV is mounted, which it will look like it is not because /proc/mounts shows /dev/sdb instead of /dev/sda, and so it won't umount $SCRATCH_MNT, and then that test will fail because we can't mkfs the device because it is busy. I reproduced this on a box that doesn't use /etc/mtab by doing ./check btrfs/307 generic/015 and 015 would fail. With this patch it passes now. Thanks, Signed-off-by: Josef Bacik --- tests/btrfs/307 | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tests/btrfs/307 b/tests/btrfs/307 index 87314c6..15157b3 100644 --- a/tests/btrfs/307 +++ b/tests/btrfs/307 @@ -35,6 +35,7 @@ _cleanup() { cd / rm -f $tmp.* + umount $SCRATCH_MNT } # get standard environment, filters and checks