xfs
[Top] [All Lists]

Re: [PATCH] xfstests: exit non-0 if fs check fails

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: exit non-0 if fs check fails
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Wed, 31 Mar 2010 20:25:49 -0500
Cc: Eric Sandeen <sandeen@xxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <20100401001956.GL7671@dastard>
References: <4BB3DCEF.8040704@xxxxxxxxxx> <20100401001956.GL7671@dastard>
User-agent: Thunderbird 2.0.0.24 (Macintosh/20100228)
Dave Chinner wrote:
> On Wed, Mar 31, 2010 at 06:38:23PM -0500, Eric Sandeen wrote:
>> Right now if any of the _check_scratch_fs tests etc fail,
>> the check script exits but with 0 status.
>>
>> This change will cause the status to be non-0 so we can detect
>> the error.
>>
>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
> 
> Wouldn't it be better to do:
> 
> -   [ $ok -eq 0 ] && exit 1
> +    if [ $ok -eq 0 ]; then
> +     status=1
> +     exit 1
> +    fi
> 
> To catch all failures rather than just the fsck failure?

sure, that sounds better.  I'll check that version in w/ your SOB
unless I hear otherwise :)

Thanks,
-Eric

>> ---
>>
>> (aside - we could make it 2 instead of 1, so that a calling script
>> could fsck and continue ... thoughts?)
> 
> I think if a test corrupts a filesystem, the test run should stop
> so the failure can be analysed without needing to reproduce it
> again...
> 
> Cheers,
> 
> Dave.

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