From patchwork Fri Jan 24 09:09:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Shilong X-Patchwork-Id: 3533791 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 3095C9F377 for ; Fri, 24 Jan 2014 09:11:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B9E220161 for ; Fri, 24 Jan 2014 09:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64F8B2012F for ; Fri, 24 Jan 2014 09:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbaAXJLW (ORCPT ); Fri, 24 Jan 2014 04:11:22 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:30541 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750753AbaAXJLT (ORCPT ); Fri, 24 Jan 2014 04:11:19 -0500 X-IronPort-AV: E=Sophos;i="4.95,711,1384272000"; d="scan'208";a="9450877" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 24 Jan 2014 17:07:34 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id s0O9BFhu005928; Fri, 24 Jan 2014 17:11:15 +0800 Received: from wangs.fnst.cn.fujitsu.com ([10.167.226.104]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2014012417094849-1342439 ; Fri, 24 Jan 2014 17:09:48 +0800 From: Wang Shilong To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] Btrfs: add regression test for transaction abortion when remounting Date: Fri, 24 Jan 2014 17:09:56 +0800 Message-Id: <1390554597-11076-1-git-send-email-wangsl.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/24 17:09:48, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2014/01/24 17:09:48, Serialize complete at 2014/01/24 17:09:48 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.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Btrfs would get a transaction abortion when remounting RW to RO with flushoncommit enabled.This test is to check if bug still exists. Signed-off-by: Wang Shilong --- tests/btrfs/032 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/032.out | 3 +++ tests/btrfs/group | 1 + 3 files changed, 61 insertions(+) create mode 100755 tests/btrfs/032 create mode 100644 tests/btrfs/032.out diff --git a/tests/btrfs/032 b/tests/btrfs/032 new file mode 100755 index 0000000..0b666e5 --- /dev/null +++ b/tests/btrfs/032 @@ -0,0 +1,57 @@ +#!/bin/bash +# FS QA Test No. btrfs/032 +# +# Regression test for transaction abortion when remounting RW to RO +# with flushoncommit option enabled. +# +#----------------------------------------------------------------------- +# Copyright (c) 2014 Fujitsu. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! + +_cleanup() +{ + rm -f $tmp.* +} + +trap "_cleanup ; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs btrfs +_supported_os Linux +_require_scratch + +_scratch_mkfs > /dev/null 2>&1 +_scratch_mount "-o flushoncommit" + +$XFS_IO_PROG -f -c "pwrite 0 10M" "$SCRATCH_MNT/tmpfile" | _filter_xfs_io + +_scratch_mount "-o remount,ro" + +status=0 ; exit diff --git a/tests/btrfs/032.out b/tests/btrfs/032.out new file mode 100644 index 0000000..bd0ac21 --- /dev/null +++ b/tests/btrfs/032.out @@ -0,0 +1,3 @@ +QA output created by 032 +wrote 10485760/10485760 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/btrfs/group b/tests/btrfs/group index 2e2b8e1..7f48b04 100644 --- a/tests/btrfs/group +++ b/tests/btrfs/group @@ -34,3 +34,4 @@ 029 auto quick 030 auto quick 031 auto quick +032 auto quick