From patchwork Wed Aug 30 14:51:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9929881 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 5E1E4603B4 for ; Wed, 30 Aug 2017 14:51:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E812286AB for ; Wed, 30 Aug 2017 14:51:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 435FA286AE; Wed, 30 Aug 2017 14:51:50 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 DC802286AB for ; Wed, 30 Aug 2017 14:51:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbdH3Ovs (ORCPT ); Wed, 30 Aug 2017 10:51:48 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:33482 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751811AbdH3Ovd (ORCPT ); Wed, 30 Aug 2017 10:51:33 -0400 Received: by mail-wr0-f195.google.com with SMTP id k94so4320178wrc.0; Wed, 30 Aug 2017 07:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hVlFOGaPMm9tAv+RWQ97lwVo2NJPWcDApDURbhrOjGs=; b=QbepCk6e33OXz6ZfKvGVY/9ttNVOHffhcEsuWcHYL8e7BaaSOf3V17taDAW5bMPOSu rLQHDJ4kZRnu/6JqAJRguglD98Vm3MrJ52D6V5Nv080c6ytK1Cvp/c9GTfkZB5xeLdRA hH9zd6Aq48C0T0f0oaF34ZHVRqOvvdrmh6RYdqXzjvvvlNtFKzUnTk497bB0nxecoup5 +3rS4ynANqRj7umPrl9H6GKvILwBgeSm4QGr0hO4x60Uqy82VG5MXzUFaMHN0c6E4IYL jLY0HMRMR0M77gZulLZBHbXtyFmKxl5SnyB36qI0Y8aT57LSZDijezDo8naU6gakv+8c s2Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hVlFOGaPMm9tAv+RWQ97lwVo2NJPWcDApDURbhrOjGs=; b=AJy1FX/gIVeWuZ8Ja5IJVPkeeN+7wL42XJp2y3XlbwmNwrTPP03mfSqeJOnYia6LvP k5MzScMsMJLExoB8+F/HznQndt5zzA4W5TY5gSBbTwpUXw7ApiYYCMvTr8S9fnmkOIWF 6ul5uoDusq4iJ2bO+L8XVUW9jH3/7NBF6L2n7yocVYZKHefunqdQrmZdfEnJk2Qwyl3X 87v7wS6+U9oHc6NF7Lfau00hns5Gk5SFwehUqJPkVB2lwo1tjUcT7sROClZP3bV5oNEe MQK2aBW8XgZDGMTSxyIaamlDi13c/tW/pCTCyb9dmAq+UNL4NHBVN4aoy4+kWmQURjXl Dtcg== X-Gm-Message-State: AHYfb5h7OCF2XnZH0aXYATVMMOlw/TpE4f3mLw97M+TuQ3OxP0tH9UsJ YKU0XNyHM8XXbg== X-Received: by 10.223.148.199 with SMTP id 65mr1300625wrr.0.1504104692436; Wed, 30 Aug 2017 07:51:32 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id f42sm2606306wrf.27.2017.08.30.07.51.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 07:51:31 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , "Darrick J . Wong" , Christoph Hellwig , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 09/14] fsx: add support for -g filldata Date: Wed, 30 Aug 2017 17:51:41 +0300 Message-Id: <1504104706-11965-10-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504104706-11965-1-git-send-email-amir73il@gmail.com> References: <1504104706-11965-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP -g X: write character X instead of random generated data This is useful to compare holes between good and bad buffer. Signed-off-by: Amir Goldstein --- ltp/fsx.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ltp/fsx.c b/ltp/fsx.c index dd6b637..a75bc55 100644 --- a/ltp/fsx.c +++ b/ltp/fsx.c @@ -132,6 +132,7 @@ unsigned long simulatedopcount = 0; /* -b flag */ int closeprob = 0; /* -c flag */ int debug = 0; /* -d flag */ unsigned long debugstart = 0; /* -D flag */ +char filldata = 0; /* -g flag */ int logid = 0; /* -j flag */ int flush = 0; /* -f flag */ int do_fsync = 0; /* -y flag */ @@ -817,6 +818,8 @@ gendata(char *original_buf, char *good_buf, unsigned offset, unsigned size) good_buf[offset] = testcalls % 256; if (offset % 2) good_buf[offset] += original_buf[offset]; + if (filldata) + good_buf[offset] = filldata; offset++; } } @@ -1631,11 +1634,12 @@ void usage(void) { fprintf(stdout, "usage: %s", - "fsx [-dnqxAFLOWZ] [-b opnum] [-c Prob] [-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 [-dnqxAFLOWZ] [-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\ -f flush and invalidate cache after I/O\n\ + -g X: write character X instead of random generated data\n\ -i logdev: do integrity testing, logdev is the dm log writes device\n\ -j logid: prefix logs with this id\n\ -l flen: the upper bound on file size (default 262144)\n\ @@ -1873,7 +1877,7 @@ main(int argc, char **argv) setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */ while ((ch = getopt_long(argc, argv, - "b:c:dfi:j:l:m:no:p:qr:s:t:w:xyAD:FKHzCILN:OP:RS:WZ", + "b:c:dfg:i:j:l:m:no:p:qr:s:t:w:xyAD:FKHzCILN:OP:RS:WZ", longopts, NULL)) != EOF) switch (ch) { case 'b': @@ -1900,6 +1904,9 @@ main(int argc, char **argv) case 'f': flush = 1; break; + case 'g': + filldata = *optarg; + break; case 'i': integrity = 1; logdev = strdup(optarg);