coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] dd: add a flag to discard cached data


From: Jim Meyering
Subject: Re: [PATCH] dd: add a flag to discard cached data
Date: Thu, 24 Feb 2011 11:05:13 +0100

Pádraig Brady wrote:

> On 24/02/11 07:52, Jim Meyering wrote:
>> One quick question: does the test need
>> something to make it skip (not fail)
>> on systems that lack kernel support for the feature?
>
> Oops right.
> Attached is latest version.
...
> +# Advise to drop cache for whole file
> +if ! dd if=ifile iflag=nocache count=0 2>err; then
> +  if grep -F 'Operation not supported' err >/dev/null; then
> +     warn_ 'skipping part; this file system lacks support for 
> posix_fadvise()'
> +     skip=1
> +  else
> +    fail=1
> +  fi
> +fi

Thanks for the quick fix.
That looks fine, but I'd drop the use of -F,
since it's just an optimization in this case, and
probably not portable to some crufty targets.

Hmm.. but I see uses of grep -F in other tests and
even in bootstrap, so maybe it's not a problem, these days:

    $ git grep -l grep.-F
    bootstrap
    tests/cp/cp-mv-enotsup-xattr
    tests/cp/fiemap-perf
    tests/misc/xattr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]