From patchwork Tue Apr 17 14:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10345409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0B126039A for ; Tue, 17 Apr 2018 14:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9D2B2837D for ; Tue, 17 Apr 2018 14:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBC42283F2; Tue, 17 Apr 2018 14:53:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D2172837D for ; Tue, 17 Apr 2018 14:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751230AbeDQOxl (ORCPT ); Tue, 17 Apr 2018 10:53:41 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:34694 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeDQOxk (ORCPT ); Tue, 17 Apr 2018 10:53:40 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3HEon2e076794; Tue, 17 Apr 2018 14:53:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=TZnFfHEBeXQGqLSEPJEl2U2M7vyKgecXrL2ZyTsTeKE=; b=giINJA+QxYYslNrUw080C3MqS4LKxeH0hfvvkxTP2O77Ta5LXtXM3ieBlDShwxi4/Z1i t4WTGSmt1kAH1vxB0AXVmPVrIS0KI74ZVLTyAuCQoXvxIg1fCLCdAtx0GxDMQ4B7ec3B eB7pqAaEhaJpoX2d10mA7TgN7V7mT8nty2BB0jrEQUUm8mjKJOu/HmpIcQE1qeMMesP8 DIF5GFiKS/Py6CGw36eAeRtic+S/vMZUWj0KlsQBpZHS3kvmMRJTeOulJ2eBPVjI5VE4 Hof8bM+iTrbL4EQAvpTH6eeUmN9OBPNQoWrU5VIVK34BuwnACNqNK6imN6BGWwDt4EBw CA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2hbamf2ewq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Apr 2018 14:53:37 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3HErbbN029631 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Apr 2018 14:53:37 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w3HEraFW007052; Tue, 17 Apr 2018 14:53:37 GMT Received: from tp.jp.oracle.com (/10.191.3.50) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Apr 2018 07:53:36 -0700 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, dsterba@suse.cz Subject: [PATCH 1/1] fstests: btrfs/130 fix Invalid argument Date: Tue, 17 Apr 2018 22:55:37 +0800 Message-Id: <20180417145537.12689-1-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8865 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=13 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804170134 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP btrfs-progs patch[1] replaced read(2) write(2) with splice(2) and caused the append-redirect to stop working. Before: btrfs send /btrfs/ro_send > /dev/null At subvol /btrfs/ro_snap btrfs send /btrfs/ro_send >> /dev/null At subvol /btrfs/ro_snap After: btrfs send /btrfs/ro_send > /dev/null At subvol /btrfs/ro_snap btrfs send /btrfs/ro_send >> /dev/null At subvol /btrfs/ro_snap ERROR: failed to read stream from kernel: Invalid argument Further in the test case the line.. btrfs/130 :: _run_btrfs_util_prog send $SCRATCH_MNT/ro_snap > /dev/null 2>&1 which intended to redirect send output to /dev/null, but ended up append redirect to the $seqres.full file. And so this test case failed as 'Invalid argument' for sometime now. Still as append of a btrfs send output doesn't make sense, so fix the fstests. Also adds logs going into $seqres.full. [1] ba23855cdc8961bbaef1fcad4854d494cdb3afd3 btrfs-progs: send: use splice syscall instead of read/write to transfer buffer Signed-off-by: Anand Jain --- tests/btrfs/130 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/btrfs/130 b/tests/btrfs/130 index edb7397a1ceb..96c8f9d9d526 100755 --- a/tests/btrfs/130 +++ b/tests/btrfs/130 @@ -67,12 +67,14 @@ nr_extents=$((4096 * $LOAD_FACTOR)) blocksize=$((128 * 1024)) file=$SCRATCH_MNT/foobar +echo LOAD_FACTOR=$LOAD_FACTOR nr_extents=$nr_extents blocksize=$blocksize >> $seqres.full + # create the initial file, whose file extents are all point to one extent _pwrite_byte 0xcdcdcdcd 0 $blocksize $file | _filter_xfs_io for i in $(seq 1 $(($nr_extents - 1))); do _reflink_range $file 0 $file $(($i * $blocksize)) $blocksize \ - > /dev/null 2>&1 + >> $seqres.full 2>&1 done # create a RO snapshot, so we can send out the snapshot @@ -82,7 +84,8 @@ _run_btrfs_util_prog subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/ro_snap # 1) OOM since memory is allocated inside a O(n^3) loop # 2) Softlock since time consuming backref walk is called without scheduling. # the send destination is not important, just send will cause the problem -_run_btrfs_util_prog send $SCRATCH_MNT/ro_snap > /dev/null 2>&1 +echo "# $BTRFS_UTIL_PROG send $SCRATCH_MNT/ro_snap > /dev/null" >> $seqres.full +$BTRFS_UTIL_PROG send $SCRATCH_MNT/ro_snap > /dev/null 2>>$seqres.full # success, all done status=0