All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] fsstress: add the [-l loops] option
@ 2015-05-28  0:58 Theodore Ts'o
  2015-05-28  0:58 ` [PATCH 2/2] fsstress: add the -c option Theodore Ts'o
  2015-05-28  1:32 ` [PATCH 1/2] fsstress: add the [-l loops] option Eric Sandeen
  0 siblings, 2 replies; 5+ messages in thread
From: Theodore Ts'o @ 2015-05-28  0:58 UTC (permalink / raw)
  To: fstests; +Cc: Theodore Ts'o

This feature is in the ltp version of fsstress; port it into
xfstests.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 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");
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-05-28 18:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28  0:58 [PATCH 1/2] fsstress: add the [-l loops] option Theodore Ts'o
2015-05-28  0:58 ` [PATCH 2/2] fsstress: add the -c option Theodore Ts'o
2015-05-28  1:32 ` [PATCH 1/2] fsstress: add the [-l loops] option Eric Sandeen
2015-05-28 18:25   ` Theodore Ts'o
2015-05-28 18:49     ` Eric Sandeen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.