From patchwork Wed Nov 29 16:33:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodrigues X-Patchwork-Id: 10082761 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 E0D0960311 for ; Wed, 29 Nov 2017 16:34:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA9EC29B4B for ; Wed, 29 Nov 2017 16:34:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF85829B4C; Wed, 29 Nov 2017 16:34:06 +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 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 498FD29B53 for ; Wed, 29 Nov 2017 16:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753706AbdK2QeF (ORCPT ); Wed, 29 Nov 2017 11:34:05 -0500 Received: from mx2.suse.de ([195.135.220.15]:45704 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310AbdK2QeF (ORCPT ); Wed, 29 Nov 2017 11:34:05 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 25F6FABD9; Wed, 29 Nov 2017 16:34:04 +0000 (UTC) From: Goldwyn Rodrigues To: darrick.wong@oracle.com, eguan@redhat.com Cc: fstests@vger.kernel.org, Goldwyn Rodrigues Subject: [PATCH 1/3] Check pwrite parameters Date: Wed, 29 Nov 2017 10:33:56 -0600 Message-Id: <20171129163358.19759-1-rgoldwyn@suse.de> X-Mailer: git-send-email 2.14.2 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Goldwyn Rodrigues There are some parameters added with xfs_io. Check if the pwrite parameters are available. For some cases, xfs_io now returns "command -%c not supported", so added "not supported" to count as error. Signed-off-by: Goldwyn Rodrigues Change since v2: - More comments - opts to become local variable --- common/rc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 4c053a53..90408b7e 100644 --- a/common/rc +++ b/common/rc @@ -2035,6 +2035,7 @@ _require_xfs_io_command() shift local param="$*" local param_checked=0 + local opts="" testfile=$TEST_DIR/$$.xfs_io case $command in @@ -2079,6 +2080,15 @@ _require_xfs_io_command() echo $testio | grep -q "invalid option" && \ _notrun "xfs_io $command support is missing" ;; + "pwrite") + # -N (RWF_NOWAIT) only works with direct I/O writes + if [ "$param" == "-N" ]; then + opts+=" -d" + fi + testio=`$XFS_IO_PROG -f $opts -c "pwrite $param 0 1M" \ + $testfile 2>&1` + param_checked=1 + ;; "scrub"|"repair") testio=`$XFS_IO_PROG -x -c "$command probe 0" $TEST_DIR 2>&1` echo $testio | grep -q "Inappropriate ioctl" && \ @@ -2109,7 +2119,9 @@ _require_xfs_io_command() $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ _notrun "xfs_io $command doesn't support $param" else - echo $testio | grep -q "invalid option" && \ + # xfs_io could result in "command %c not supported" if it was + # built on kernels not supporting pwritev2() calls + echo $testio | grep -q "\(invalid option\|not supported\)" && \ _notrun "xfs_io $command doesn't support $param" fi }