From patchwork Wed Nov 15 12:11:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 10059285 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 D40DF6056E for ; Wed, 15 Nov 2017 12:11:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CEDBE29F2C for ; Wed, 15 Nov 2017 12:11:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C3F8129F33; Wed, 15 Nov 2017 12:11:45 +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 76C8229F30 for ; Wed, 15 Nov 2017 12:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757744AbdKOMLo (ORCPT ); Wed, 15 Nov 2017 07:11:44 -0500 Received: from mx2.suse.de ([195.135.220.15]:46155 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757642AbdKOMLo (ORCPT ); Wed, 15 Nov 2017 07:11:44 -0500 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 mx2.suse.de (Postfix) with ESMTP id D8D5DAB9A; Wed, 15 Nov 2017 12:11:42 +0000 (UTC) From: Nikolay Borisov To: linux-xfs@vger.kernel.org Cc: fstests@vger.kernel.org, eguan@redhat.com, david@fromorbit.com, darrick.wong@oracle.com, Nikolay Borisov Subject: [PATCH v4 2/3] common: Implement fiemap's range query check Date: Wed, 15 Nov 2017 14:11:39 +0200 Message-Id: <1510747900-13440-2-git-send-email-nborisov@suse.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510747900-13440-1-git-send-email-nborisov@suse.com> References: <1510747821-13270-1-git-send-email-nborisov@suse.com> <1510747900-13440-1-git-send-email-nborisov@suse.com> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow for users of xfstest to assert the presence of fiemap's range query capabilities by requesting the "ranged" parameter. Signed-off-by: Nikolay Borisov --- common/rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/rc b/common/rc index e2a8229..c98c224 100644 --- a/common/rc +++ b/common/rc @@ -2053,6 +2053,12 @@ _require_xfs_io_command() -c "$command 4k 8k" $testfile 2>&1` ;; "fiemap") + if echo "$param" | grep -q "ranged"; then + param=$(echo "$param" | sed "s/ranged//") + $XFS_IO_PROG -F -f -c "pwrite 0 5k" -c "fsync" $testfile > /dev/null 2>&1 + lines=$($XFS_IO_PROG -c "fiemap 6k" $testfile 2>&1 | wc -l) + [ $lines -eq 1 ] || _notrun "xfs_io $command ranged support is missing" + fi testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \ -c "fiemap -v $param" $testfile 2>&1` param_checked=1