From patchwork Thu May 28 00:58:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 6495601 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC213C0020 for ; Thu, 28 May 2015 00:58:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F24B920734 for ; Thu, 28 May 2015 00:58:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E92A320528 for ; Thu, 28 May 2015 00:58:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751848AbbE1A6v (ORCPT ); Wed, 27 May 2015 20:58:51 -0400 Received: from imap.thunk.org ([74.207.234.97]:33394 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751711AbbE1A6u (ORCPT ); Wed, 27 May 2015 20:58:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=Message-Id:Date:Subject:Cc:To:From; bh=FXVG0Z0DvceJSVBOf/tpdoRuvhz6pGed5YSmBIxP/ZE=; b=WA/RmnT3caNS2FY1JO3nwSAgBl4Yd/wZqR1jQUv5qV2Tm/Lqiqm4NBmQKHCS8yETBvSLEqbaSXGiytpe2JkBI8w0eGH7Efkb+VfS0OLQOLCl4jiFUY6RP+FPHptT7v1Z73T9qqqrg2YmHircchJpIuFHnjx0+I4Itd+pL0vN0Ho=; Received: from root (helo=closure.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.80) (envelope-from ) id 1Yxm9p-0005sv-Oc; Thu, 28 May 2015 00:58:49 +0000 Received: by closure.thunk.org (Postfix, from userid 15806) id 072905802A4; Wed, 27 May 2015 20:58:49 -0400 (EDT) From: Theodore Ts'o To: fstests@vger.kernel.org Cc: Theodore Ts'o Subject: [PATCH 1/2] fsstress: add the [-l loops] option Date: Wed, 27 May 2015 20:58:45 -0400 Message-Id: <1432774726-26824-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 2.3.0 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This feature is in the ltp version of fsstress; port it into xfstests. Signed-off-by: Theodore Ts'o --- ltp/fsstress.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ltp/fsstress.c b/ltp/fsstress.c index aa3e0c3..ad0c65f 100644 --- a/ltp/fsstress.c +++ b/ltp/fsstress.c @@ -330,7 +330,8 @@ int main(int argc, char **argv) int nousage = 0; xfs_error_injection_t err_inj; struct sigaction action; - const char *allopts = "d:e:f:i:m:M:n:o:p:rs:S:vVwx:X:zH"; + int loops = 1; + const char *allopts = "d:e:f:i:l:m:M:n:o:p:rs:S:vVwx:X:zH"; errrange = errtag = 0; umask(0); @@ -372,6 +373,9 @@ int main(int argc, char **argv) exit(1); } break; + case 'l': + loops = atoi(optarg); + break; case 'n': operations = atoi(optarg); break; @@ -538,7 +542,8 @@ int main(int argc, char **argv) } } procid = i; - doproc(); + for (i = 0; !loops || (i < loops); i++) + doproc(); return 0; } } @@ -896,10 +901,12 @@ doproc(void) rval = stat64(".", &statbuf); if (rval == EIO) { fprintf(stderr, "Detected EIO\n"); - return; + goto errout; } } } +errout: + chdir(".."); } /* @@ -1572,7 +1579,7 @@ void usage(void) { printf("Usage: %s -H or\n", myprog); - printf(" %s [-d dir][-e errtg][-f op_name=freq][-n nops]\n", + printf(" %s [-d dir][-e errtg][-f op_name=freq][-l loops][-n nops]\n", myprog); printf(" [-p nproc][-r len][-s seed][-v][-w][-x cmd][-z][-S][-X ncmd]\n"); printf("where\n"); @@ -1582,6 +1589,8 @@ usage(void) printf(" the valid operation names are:\n"); show_ops(-1, " "); printf(" -i filenum get verbose output for this nth file object\n"); + printf(" -l loops specifies the no. of times the testrun should loop.\n"); + printf(" *use 0 for infinite (default 1)\n"); printf(" -m modulo uid/gid modulo for chown/chgrp (default 32)\n"); printf(" -n nops specifies the no. of operations per process (default 1)\n"); printf(" -o logfile specifies logfile name\n");