From patchwork Wed Sep 18 20:48:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 2909381 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 BF8D89F1BF for ; Wed, 18 Sep 2013 20:48:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B24A1203E8 for ; Wed, 18 Sep 2013 20:48:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69F4F203E1 for ; Wed, 18 Sep 2013 20:48:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753711Ab3IRUsk (ORCPT ); Wed, 18 Sep 2013 16:48:40 -0400 Received: from dkim2.fusionio.com ([66.114.96.54]:38209 "EHLO dkim2.fusionio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751635Ab3IRUsj (ORCPT ); Wed, 18 Sep 2013 16:48:39 -0400 Received: from mx1.fusionio.com (unknown [10.101.1.160]) by dkim2.fusionio.com (Postfix) with ESMTP id 70BEA9A0420 for ; Wed, 18 Sep 2013 14:48:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fusionio.com; s=default; t=1379537319; bh=pLsXSTBok/Fn29mfS6A6VdEuFIKr8IdRJa7RncTqV+Q=; h=From:To:Subject:Date; b=awTMR/bWqy3oq9n20J5OYX+35SdutpkpKTqdVkW8rttV5iSPL6sjoiSGageI1BjEq jlqHZW3guaGzk1gu8Ze9iPl0+TY8522AzzldfuPNEPDiStOqnEyz+LbpXXD7W+1XT1 ytlg797TF634pdfJrl2G6hb6BpLYPmwjuMtvo3/w= X-ASG-Debug-ID: 1379537309-03d6a50f73f1ca0001-6jHSXT Received: from CAS1.int.fusionio.com (cas1.int.fusionio.com [10.101.1.40]) by mx1.fusionio.com with ESMTP id 42veGOzAClVTLciu (version=TLSv1 cipher=AES128-SHA bits=128 verify=NO); Wed, 18 Sep 2013 14:48:29 -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; Wed, 18 Sep 2013 14:48:28 -0600 From: Josef Bacik To: , Subject: [PATCH] xfstests: fix set-default test in btrfs/001 Date: Wed, 18 Sep 2013 16:48:27 -0400 X-ASG-Orig-Subj: [PATCH] xfstests: fix set-default test in btrfs/001 Message-ID: <1379537307-21681-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: 1379537309 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-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.140733 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.4 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 were actually testing this improperly, there was a bug in the set default code so we weren't actually honoring the 0 subvolid properly. To fix this we need to get the subvolid for the subvol we want to set as the default and use that in the command. With this patch we now pass again with the fix for the 0 subvolid. Thanks, Signed-off-by: Josef Bacik Tested-by: David Sterba Reviewed-by: Rich Johnston --- tests/btrfs/001 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/btrfs/001 b/tests/btrfs/001 index 9aa2431..c05d772 100755 --- a/tests/btrfs/001 +++ b/tests/btrfs/001 @@ -77,7 +77,8 @@ ls $SCRATCH_MNT/subvol echo "Creating file bar in subvol" dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null echo "Setting subvol to the default" -$BTRFS_UTIL_PROG subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch +subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT subvol) +$BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT | _filter_scratch _scratch_remount echo "List root dir which is now subvol" ls $SCRATCH_MNT