From patchwork Mon Jun 26 16:40:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 9810089 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 B4AB2603F3 for ; Mon, 26 Jun 2017 16:40:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A08285D2 for ; Mon, 26 Jun 2017 16:40:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A638C28691; Mon, 26 Jun 2017 16:40:59 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 5CD212860D for ; Mon, 26 Jun 2017 16:40:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751386AbdFZQk7 (ORCPT ); Mon, 26 Jun 2017 12:40:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:54572 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751415AbdFZQk6 (ORCPT ); Mon, 26 Jun 2017 12:40:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 51BA3AB1E; Mon, 26 Jun 2017 16:40:57 +0000 (UTC) Received: from localhost (hermes.olymp [local]) by hermes.olymp (OpenSMTPD) with ESMTPA id b01fcc49; Mon, 26 Jun 2017 16:40:55 +0000 (UTC) From: Luis Henriques To: fstests@vger.kernel.org Cc: Anna Schumaker , Luis Henriques Subject: [PATCH 2/2] common/rc: handle xfs_io copy_range when copy_file_range syscall isn't available Date: Mon, 26 Jun 2017 17:40:53 +0100 Message-Id: <20170626164053.7634-2-lhenriques@suse.com> In-Reply-To: <20170626164053.7634-1-lhenriques@suse.com> References: <20170626164053.7634-1-lhenriques@suse.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP _require_xfs_io_command() isn't handling the case where the copy_file_range syscall isn't available. Unfortunately, old versions of xfs_io don't handle it correctly either and the test will succeed with an empty file. To fix this function, we need to add two checks: 1) for old xfs_io versions, fail if the test seems to succeed (no output) but the file created is empty, 2) for newer versions, use the error returned. Signed-off-by: Luis Henriques --- common/rc | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/rc b/common/rc index 2972f89e9527..aad065cb2ade 100644 --- a/common/rc +++ b/common/rc @@ -2146,6 +2146,10 @@ _require_xfs_io_command() $XFS_IO_PROG -F -f -c "pwrite 0 4k" $testfile > /dev/null 2>&1 testio=`$XFS_IO_PROG -F -f -c "copy_range $testfile" $testcopy 2>&1` rm -f $testcopy > /dev/null 2>&1 + [ -z "$testio" -a ! -s "$testcopy" ] && \ + _notrun "xfs_io $command support is missing" + echo $testio | egrep -q "Function not implemented" && \ + _notrun "xfs_io $command support is missing" ;; "falloc" ) testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1`