From patchwork Wed May 21 16:30:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 4217761 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 79DDCBEEAB for ; Wed, 21 May 2014 15:30:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D3C520375 for ; Wed, 21 May 2014 15:30:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C8262037A for ; Wed, 21 May 2014 15:30:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbaEUPad (ORCPT ); Wed, 21 May 2014 11:30:33 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:38551 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752480AbaEUPac (ORCPT ); Wed, 21 May 2014 11:30:32 -0400 Received: by mail-wg0-f45.google.com with SMTP id m15so2136488wgh.4 for ; Wed, 21 May 2014 08:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=+6UZtLwdV08khtZnbRpUFh5IvIIaX0zmnduqBcF1INA=; b=NSfjs4YrpjNWu8MYEBx8RswgH++I/Zjy8tWQIpgJS+K3/1ScR0PDdpCAhYDvQCKhOe b7bGjHRRp06jHgHQdo+TyBJ5vurSvEVHDTsxmqPbxy8f01MeSYLbbsZZobjtDgiGUgny r6cMu/NIe8v2IA7JyLk29SBUh0Y89PePXNfwqJr8JwVDJsjfVhEwZL2cShE7irRsFGbt gXH2v9Y5zshpGDDZnV4j97TmE33le+HqlwIuZPK1IRy0YUYuAgvdBOvqRMgrf5Z62SGe pBJot2nchB+kp7JZQ70mbFs73WxiDu5MTN3tLTE/hjoXfYJikrHSAs608iMX+A1UBlb/ u0Mg== X-Received: by 10.194.133.100 with SMTP id pb4mr2701130wjb.39.1400686230816; Wed, 21 May 2014 08:30:30 -0700 (PDT) Received: from debian-vm3.lan (bl10-252-12.dsl.telepac.pt. [85.243.252.12]) by mx.google.com with ESMTPSA id l2sm2845642wix.13.2014.05.21.08.30.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 May 2014 08:30:30 -0700 (PDT) From: Filipe David Borba Manana To: xfs@oss.sgi.com Cc: linux-btrfs@vger.kernel.org, Filipe David Borba Manana Subject: [PATCH] xfstests: add test for btrfs send with long paths Date: Wed, 21 May 2014 17:30:18 +0100 Message-Id: <1400689818-14400-1-git-send-email-fdmanana@gmail.com> X-Mailer: git-send-email 1.9.1 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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Regression test for btrfs send where long paths (exceeding 230 characters) made send produce paths with random characters from a memory buffer returned by kmalloc, as send forgot to populate the new buffer with the path string. This issue is fixed by the following linux kernel btrfs patch: Btrfs: send, fix corrupted path strings for long paths Signed-off-by: Filipe David Borba Manana --- tests/btrfs/051 | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/051.out | 1 + tests/btrfs/group | 1 + 3 files changed, 87 insertions(+) create mode 100755 tests/btrfs/051 create mode 100644 tests/btrfs/051.out diff --git a/tests/btrfs/051 b/tests/btrfs/051 new file mode 100755 index 0000000..53df664 --- /dev/null +++ b/tests/btrfs/051 @@ -0,0 +1,85 @@ +#! /bin/bash +# FS QA Test No. btrfs/051 +# +# Regression test for btrfs send where long paths (exceeding 230 characters) +# made send produce paths with random characters from a memory buffer returned +# by kmalloc, as send forgot to populate the new buffer with the path string. +# +# This issue is fixed by the following linux kernel btrfs patch: +# +# Btrfs: send, fix corrupted path strings for long paths +# +#----------------------------------------------------------------------- +# Copyright (c) 2014 Filipe Manana. 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" + +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + rm -fr $send_files_dir + rm -fr $tmp +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs btrfs +_supported_os Linux +_require_scratch +_require_fssum +_need_to_be_root + +send_files_dir=$TEST_DIR/btrfs-test-$seq + +rm -f $seqres.full +rm -fr $send_files_dir +mkdir $send_files_dir + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +TEST_PATH="$SCRATCH_MNT/fdmanana/.config/google-chrome-mysetup/Default/Pepper_Data/Shockwave_Flash/WritableRoot/#SharedObjects/JSHJ4ZKN/s.wsj.net/[[IMPORT]]/players.edgesuite.net/flash/plugins/osmf/advanced-streaming-plugin/v2.7/osmf1.6/Ak#" + +mkdir -p $TEST_PATH +echo "hello world" > $TEST_PATH/amaiAdvancedStreamingPlugin.txt + +_run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/mysnap1 +run_check $FSSUM_PROG -A -f -w $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1 +_run_btrfs_util_prog send $SCRATCH_MNT/mysnap1 -f $send_files_dir/1.snap + +_scratch_unmount +_check_scratch_fs + +_scratch_mkfs >/dev/null 2>&1 +_scratch_mount + +_run_btrfs_util_prog receive $SCRATCH_MNT -f $send_files_dir/1.snap +run_check $FSSUM_PROG -r $send_files_dir/1.fssum $SCRATCH_MNT/mysnap1 + +_check_scratch_fs + +status=0 +exit diff --git a/tests/btrfs/051.out b/tests/btrfs/051.out new file mode 100644 index 0000000..636dcef --- /dev/null +++ b/tests/btrfs/051.out @@ -0,0 +1 @@ +QA output created by 051 diff --git a/tests/btrfs/group b/tests/btrfs/group index 69a80e0..0673449 100644 --- a/tests/btrfs/group +++ b/tests/btrfs/group @@ -53,3 +53,4 @@ 048 auto quick 049 auto quick 050 auto +051 auto quick