[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ready for release of coreutils-8.11?
From: |
Jim Meyering |
Subject: |
Re: ready for release of coreutils-8.11? |
Date: |
Wed, 13 Apr 2011 11:45:35 +0200 |
Pádraig Brady wrote:
...
> Subject: [PATCH] tests: fix a false positive fiemap test on some file systems
>
> * tests/filefrag-extent-compare: Don't check the length of the
> last extent, as this was seen to vary on XFS, where it leaves
> trailing blocks allocated for performance reasons.
> * tests/cp/fiemap-empty: Though not seen as an issue in practise,
> try to avoid possible issues with the allocator in file systems,
> by requesting to allocate a power of 2.
> ---
> tests/cp/fiemap-empty | 16 ++++++++--------
> tests/filefrag-extent-compare | 16 ++++++++++++----
> 2 files changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/tests/cp/fiemap-empty b/tests/cp/fiemap-empty
> index 42d816b..64c3254 100755
> --- a/tests/cp/fiemap-empty
> +++ b/tests/cp/fiemap-empty
> @@ -38,8 +38,8 @@ rm falloc.test
> # which would cause failure of unrelated tests run in parallel.
> require_file_system_bytes_free_ 800000000
>
> -fallocate -l 600000000 space.test ||
> - skip_test_ 'this test needs at least 600MB free space'
> +fallocate -l 600MiB space.test ||
> + skip_test_ 'this test needs at least 600MiB free space'
Nice. More readable, too.
...
> diff --git a/tests/filefrag-extent-compare b/tests/filefrag-extent-compare
> index 2c33584..194970c 100644
> --- a/tests/filefrag-extent-compare
> +++ b/tests/filefrag-extent-compare
> @@ -56,10 +56,18 @@ merge_extents \@b;
> my $i = 0;
> while (defined $a[$i])
> {
> - $a[$i]->{L_BLK} == $b[$i]->{L_BLK} && $a[$i]->{LEN} == $b[$i]->{LEN}
> - or die "$ME: differing extent:\n"
> - . " [$i]=$a[$i]->{L_BLK} $a[$i]->{LEN}\n"
> - . " [$i]=$b[$i]->{L_BLK} $b[$i]->{LEN}\n";
> + my $start_match = $a[$i]->{L_BLK} == $b[$i]->{L_BLK};
> + my $len_match = $a[$i]->{LEN} == $b[$i]->{LEN};
> + if (!$start_match || (!$len_match && $i != (@a - 1)))
> + {
> + # On XFS on Linux kernel 2.6.38, it was seen that the size of the
> + # last extent can vary, and can extend beyond the length of the file.
> + # So we ignore the length of the last extent, because if the
> + # file is the wrong length we'll get failures elsewhere.
> + die "$ME: differing extent:\n"
> + . " [$i]=$a[$i]->{L_BLK} $a[$i]->{LEN}\n"
> + . " [$i]=$b[$i]->{L_BLK} $b[$i]->{LEN}\n";
> + }
> $i++;
> }
Thanks. That looks better still.
Maybe factor out a "!" ?
if ( ! ($start_match && ($len_match || $i == (@a - 1))
- Re: ready for release of coreutils-8.11?, (continued)
- Re: ready for release of coreutils-8.11?, Jim Meyering, 2011/04/11
- Re: ready for release of coreutils-8.11?, Pádraig Brady, 2011/04/12
- Re: ready for release of coreutils-8.11?, Jim Meyering, 2011/04/12
- Re: ready for release of coreutils-8.11?, Pádraig Brady, 2011/04/12
- Re: ready for release of coreutils-8.11?, Jim Meyering, 2011/04/12
- Re: ready for release of coreutils-8.11?, Pádraig Brady, 2011/04/12
- Re: ready for release of coreutils-8.11?, Eric Sandeen, 2011/04/12
- Re: ready for release of coreutils-8.11?, Pádraig Brady, 2011/04/12
- Re: ready for release of coreutils-8.11?, Eric Sandeen, 2011/04/12
- Re: ready for release of coreutils-8.11?, Pádraig Brady, 2011/04/13
- Re: ready for release of coreutils-8.11?,
Jim Meyering <=
- Re: ready for release of coreutils-8.11?, Jim Meyering, 2011/04/13
- Re: ready for release of coreutils-8.11?, Eric Sandeen, 2011/04/12