xfs
[Top] [All Lists]

Re: xfstests: print the message that fallocate is not supported to stdou

To: Boris Ranto <branto@xxxxxxxxxx>
Subject: Re: xfstests: print the message that fallocate is not supported to stdout unless quiet output
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 11 May 2011 11:55:33 -0500
Cc: xfs <xfs@xxxxxxxxxxx>
In-reply-to: <1305126445.22267.37.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
References: <1305126445.22267.37.camel@xxxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
On 5/11/11 10:07 AM, Boris Ranto wrote:
> ltp/fsx.c tests whether the filesystem it is run on supports fallocate. If it 
> is not supported the fsx will print warning to stderr.
> This leads to fails of tests 075, 112, 127 for the filesystems that do not 
> support fallocate. The tests use ltp/fsx but do not filter out stderr.
> Since ltp/fsx.c can work without fallocate support I propose to move this 
> message to stdout unless quiet output is not requested.
> Previous patch printed the message even if -q flag was used. This patch 
> honours the flag.
> 
> This simple patch fixes the issue for me, tested on all the mentioned tests:
> 
> Signed-off-by: Boris Ranto <branto@xxxxxxxxxx>

Good idea, sorry about that!

I'll commit this with my signoff.

-Eric

> diff --git a/ltp/fsx.c b/ltp/fsx.c
> index fe072d3..43e7efe 100644
> --- a/ltp/fsx.c
> +++ b/ltp/fsx.c
> @@ -1424,7 +1424,8 @@ main(int argc, char **argv)
>  #ifdef FALLOCATE
>         if (!lite && fallocate_calls) {
>                 if (fallocate(fd, 0, 0, 1) && errno == EOPNOTSUPP) {
> -                       warn("main: filesystem does not support fallocate, 
> disabling");
> +                       if(!quiet)
> +                               prt("fsx: main: filesystem does not support 
> fallocate, disabling\n");
>                         fallocate_calls = 0;
>                 } else
>                         ftruncate(fd, 0);
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs
> 

<Prev in Thread] Current Thread [Next in Thread>