public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests: don't print "do not support" warnings unless verbose is specified
@ 2011-08-27 17:43 Theodore Ts'o
  2011-08-29  5:36 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Theodore Ts'o @ 2011-08-27 17:43 UTC (permalink / raw)
  To: xfs, Ext4 Developers List; +Cc: Theodore Ts'o

Commit 630421f6d449 attempts to avoid printing the "fallocate not
supported" warning if the -q (quiet) option is specified on the
command-line.  Unfortunately tests 75 and 112 don't set the -q flag.
This causes test failures for file systems that don't support
fallocate or the punch hole functionality.

I considered changing tests 75 and 112 to pass -q to fsx, but that
would suppress other warning messages that could be legitimate test
failures, so I decided to add a new -v (vebose) flag.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 ltp/fsx.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ltp/fsx.c b/ltp/fsx.c
index 36b38f7..cef2c7d 100644
--- a/ltp/fsx.c
+++ b/ltp/fsx.c
@@ -132,6 +132,7 @@ int	readbdy = 1;			/* -r flag */
 int	style = 0;			/* -s flag */
 int	prealloc = 0;			/* -x flag */
 int	truncbdy = 1;			/* -t flag */
+int	verbose = 0;			/* -v flag */
 int	writebdy = 1;			/* -w flag */
 long	monitorstart = -1;		/* -m flag */
 long	monitorend = -1;		/* -m flag */
@@ -1299,8 +1300,8 @@ test_fallocate()
 #ifdef FALLOCATE
 	if (!lite && fallocate_calls) {
 		if (fallocate(fd, 0, 0, 1) && errno == EOPNOTSUPP) {
-			if(!quiet)
-				warn("main: filesystem does not support fallocate, disabling\n");
+			if (verbose)
+				warn("main: filesystem does not support fallocate, disabling");
 			fallocate_calls = 0;
 		} else {
 			ftruncate(fd, 0);
@@ -1319,7 +1320,7 @@ test_punch_hole()
 	if (!lite && punch_hole_calls) {
 		if (fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
 				0, 1) && errno == EOPNOTSUPP) {
-			if(!quiet)
+			if (verbose)
 				warn("main: filesystem does not support fallocate punch hole, disabling");
 			punch_hole_calls = 0;
 		} else
@@ -1348,7 +1349,7 @@ main(int argc, char **argv)
 
 	setvbuf(stdout, (char *)0, _IOLBF, 0); /* line buffered stdout */
 
-	while ((ch = getopt(argc, argv, "b:c:dfl:m:no:p:qr:s:t:w:xyAD:FHLN:OP:RS:WZ"))
+	while ((ch = getopt(argc, argv, "b:c:dfl:m:no:p:qr:s:t:vw:xyAD:FHLN:OP:RS:WZ"))
 	       != EOF)
 		switch (ch) {
 		case 'b':
@@ -1423,6 +1424,9 @@ main(int argc, char **argv)
 			if (truncbdy <= 0)
 				usage();
 			break;
+		case 'v':
+			verbose = 1;
+			break;
 		case 'w':
 			writebdy = getnum(optarg, &endp);
 			if (writebdy <= 0)
-- 
1.7.4.1.22.gec8e1.dirty

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: don't print "do not support" warnings unless verbose is specified
  2011-08-27 17:43 [PATCH] xfstests: don't print "do not support" warnings unless verbose is specified Theodore Ts'o
@ 2011-08-29  5:36 ` Dave Chinner
  2011-08-29 13:37   ` Ted Ts'o
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Chinner @ 2011-08-29  5:36 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List, xfs

On Sat, Aug 27, 2011 at 01:43:22PM -0400, Theodore Ts'o wrote:
> Commit 630421f6d449 attempts to avoid printing the "fallocate not
> supported" warning if the -q (quiet) option is specified on the
> command-line.  Unfortunately tests 75 and 112 don't set the -q flag.
> This causes test failures for file systems that don't support
> fallocate or the punch hole functionality.
> 
> I considered changing tests 75 and 112 to pass -q to fsx, but that
> would suppress other warning messages that could be legitimate test
> failures, so I decided to add a new -v (vebose) flag.

Oh, so now we can have verbose quietness? Or is it quiet verbosity?
That quickly leads to insanity.... :/

The quiet flag only suppresses output that is otherwise logged and
output when a failure occurs. Hence setting the quiet won't cause
any loss of functionality or error detection for these tests so you
should just add the quiet flag to the tests.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

* Re: [PATCH] xfstests: don't print "do not support" warnings unless verbose is specified
  2011-08-29  5:36 ` Dave Chinner
@ 2011-08-29 13:37   ` Ted Ts'o
  0 siblings, 0 replies; 3+ messages in thread
From: Ted Ts'o @ 2011-08-29 13:37 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Ext4 Developers List, xfs

On Mon, Aug 29, 2011 at 03:36:21PM +1000, Dave Chinner wrote:
> On Sat, Aug 27, 2011 at 01:43:22PM -0400, Theodore Ts'o wrote:
> > Commit 630421f6d449 attempts to avoid printing the "fallocate not
> > supported" warning if the -q (quiet) option is specified on the
> > command-line.  Unfortunately tests 75 and 112 don't set the -q flag.
> > This causes test failures for file systems that don't support
> > fallocate or the punch hole functionality.
> > 
> > I considered changing tests 75 and 112 to pass -q to fsx, but that
> > would suppress other warning messages that could be legitimate test
> > failures, so I decided to add a new -v (vebose) flag.
> 
> Oh, so now we can have verbose quietness? Or is it quiet verbosity?
> That quickly leads to insanity.... :/
> 
> The quiet flag only suppresses output that is otherwise logged and
> output when a failure occurs. Hence setting the quiet won't cause
> any loss of functionality or error detection for these tests so you
> should just add the quiet flag to the tests.

OK, I'll resubmit a patch which changes the tests (i.e., 75 and 112)
to pass the -q flag to fsx.  I had thought _not_ passing -q was
deliberate, but reviewing the output, it does seem that none of the
!quiet messages are all that important.

					- Ted


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

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

end of thread, other threads:[~2011-08-29 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-27 17:43 [PATCH] xfstests: don't print "do not support" warnings unless verbose is specified Theodore Ts'o
2011-08-29  5:36 ` Dave Chinner
2011-08-29 13:37   ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox