From patchwork Tue Jan 7 08:40:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11320603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EBB71138C for ; Tue, 7 Jan 2020 08:45:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D386E206DA for ; Tue, 7 Jan 2020 08:45:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726327AbgAGIpL (ORCPT ); Tue, 7 Jan 2020 03:45:11 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:49261 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725801AbgAGIpL (ORCPT ); Tue, 7 Jan 2020 03:45:11 -0500 X-IronPort-AV: E=Sophos;i="5.69,405,1571673600"; d="scan'208";a="81428037" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 Jan 2020 16:45:08 +0800 Received: from G08CNEXMBPEKD06.g08.fujitsu.local (unknown [10.167.33.206]) by cn.fujitsu.com (Postfix) with ESMTP id D731C49E9334; Tue, 7 Jan 2020 16:36:09 +0800 (CST) Received: from G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD06.g08.fujitsu.local (10.167.33.206) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 7 Jan 2020 16:45:08 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.439.0; Tue, 7 Jan 2020 16:45:13 +0800 From: Xiao Yang To: , CC: , Xiao Yang Subject: [PATCH v3 1/2] ltp/fsx.c: Add FALLOC_FL_KEEP_SIZE flag and '-K' option Date: Tue, 7 Jan 2020 16:40:52 +0800 Message-ID: <20200107084053.2889-1-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-yoursite-MailScanner-ID: D731C49E9334.AAB81 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org 1) Add FALLOC_FL_KEEP_SIZE flag for do_zero_range(). 2) Add missing '-K' option to the usage of fsx. Signed-off-by: Xiao Yang --- ltp/fsx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index 00001117..997d3f37 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -1197,7 +1197,7 @@ void do_zero_range(unsigned offset, unsigned length, int keep_size) { unsigned end_offset; - int mode = FALLOC_FL_ZERO_RANGE; + int mode = keep_size ? FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE : FALLOC_FL_ZERO_RANGE; if (length == 0) { if (!quiet && testcalls > simulatedopcount) @@ -2223,7 +2223,7 @@ void usage(void) { fprintf(stdout, "usage: %s", - "fsx [-dknqxABEFJLOWZ] [-b opnum] [-c Prob] [-g filldata] [-i logdev] [-j logid] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] fname\n\ + "fsx [-dknqxABEFJKLOWZ] [-b opnum] [-c Prob] [-g filldata] [-i logdev] [-j logid] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbdy] [-s style] [-t truncbdy] [-w writebdy] [-D startingop] [-N numops] [-P dirpath] [-S seed] fname\n\ -b opnum: beginning operation number (default 1)\n\ -c P: 1 in P chance of file close+open at each op (default infinity)\n\ -d: debug output for all operations\n\ @@ -2273,6 +2273,9 @@ usage(void) #ifdef HAVE_COPY_FILE_RANGE " -E: Do not use copy range calls\n" #endif +#ifdef FALLOC_FL_KEEP_SIZE +" -K: Do not use keep size calls\n" +#endif " -L: fsxLite - no file creations & no file size changes\n\ -N numops: total # operations to do (default infinity)\n\ -O: use oplen (see -o flag) for every op (default random)\n\ From patchwork Tue Jan 7 08:40:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 11320605 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BEC7138C for ; Tue, 7 Jan 2020 08:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 29E532081E for ; Tue, 7 Jan 2020 08:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbgAGIpQ (ORCPT ); Tue, 7 Jan 2020 03:45:16 -0500 Received: from mail.cn.fujitsu.com ([183.91.158.132]:49261 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725801AbgAGIpQ (ORCPT ); Tue, 7 Jan 2020 03:45:16 -0500 X-IronPort-AV: E=Sophos;i="5.69,405,1571673600"; d="scan'208";a="81428046" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 Jan 2020 16:45:14 +0800 Received: from G08CNEXMBPEKD05.g08.fujitsu.local (unknown [10.167.33.204]) by cn.fujitsu.com (Postfix) with ESMTP id 387E849E933D; Tue, 7 Jan 2020 16:36:13 +0800 (CST) Received: from G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD05.g08.fujitsu.local (10.167.33.204) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 7 Jan 2020 16:45:10 +0800 Received: from Fedora-30.g08.fujitsu.local (10.167.220.106) by G08CNEXCHPEKD03.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server id 14.3.439.0; Tue, 7 Jan 2020 16:45:17 +0800 From: Xiao Yang To: , CC: , Xiao Yang Subject: [PATCH v3 2/2] generic: Add check for required keep_size/punch_hole/zero_range/collapse_range Date: Tue, 7 Jan 2020 16:40:53 +0800 Message-ID: <20200107084053.2889-2-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200107084053.2889-1-yangx.jy@cn.fujitsu.com> References: <20200107084053.2889-1-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-yoursite-MailScanner-ID: 387E849E933D.AB728 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Tests need the exact operations to reproduce some issues by --replay-ops so skip tests rather than one operation if a required operation/flag in tests is not supported. Signed-off-by: Xiao Yang Reviewed-by: Amir Goldstein --- tests/generic/456 | 3 +++ tests/generic/469 | 3 +++ tests/generic/499 | 1 + tests/generic/511 | 1 + 4 files changed, 8 insertions(+) diff --git a/tests/generic/456 b/tests/generic/456 index 6124f0bb..434a0ffa 100755 --- a/tests/generic/456 +++ b/tests/generic/456 @@ -36,6 +36,9 @@ _supported_fs generic _supported_os Linux _require_scratch _require_dm_target flakey +_require_xfs_io_command "falloc" "-k" +_require_xfs_io_command "fzero" +_require_xfs_io_command "fcollapse" rm -f $seqres.full diff --git a/tests/generic/469 b/tests/generic/469 index 47fdf0cf..e9411d47 100755 --- a/tests/generic/469 +++ b/tests/generic/469 @@ -40,6 +40,9 @@ rm -f $seqres.full _supported_fs generic _supported_os Linux _require_test +_require_xfs_io_command "falloc" "-k" +_require_xfs_io_command "fpunch" +_require_xfs_io_command "fzero" run_fsx() { diff --git a/tests/generic/499 b/tests/generic/499 index 773eab2e..b3363ac4 100755 --- a/tests/generic/499 +++ b/tests/generic/499 @@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fcollapse" _require_xfs_io_command "fzero" diff --git a/tests/generic/511 b/tests/generic/511 index 4d133f49..f8022905 100755 --- a/tests/generic/511 +++ b/tests/generic/511 @@ -28,6 +28,7 @@ _cleanup() _supported_fs generic _supported_os Linux _require_scratch +_require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" rm -f $seqres.full