From 4e73fea3e3b6fb721b91bb81e5357fb805eb590d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 22 Feb 2007 19:09:35 +0100 Subject: Honor dd's noatime flag if possible, even if not supported on build fs * doc/coreutils.texi (dd invocation): Warn that noatime might not be reliable. * src/dd.c (flags, usage): Look at O_NOATIME, not HAVE_WORKING_O_NOATIME, to decide whether to support the noatime flag, so that dd attempts O_NOATIME even if the build file system does not support it. Problem reported by Jim Meyering today in bug-coreutils. * tests/dd/misc: Generate a warning, not a failure, if noatime exists but fails. --- tests/dd/misc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/dd/misc b/tests/dd/misc index 513221bce..fa5cfbe20 100755 --- a/tests/dd/misc +++ b/tests/dd/misc @@ -29,6 +29,8 @@ if test "$VERBOSE" = yes; then dd --version fi +fail=0 +warn=0 test_failure=0 echo data > $tmp_in || test_failure=1 ln $tmp_in $tmp_in2 || test_failure=1 @@ -63,8 +65,15 @@ sleep 1 if dd iflag=noatime if=$tmp_in of=$tmp_out 2> /dev/null; then new_ls=`ls -u --full-time $tmp_in` if test "x$old_ls" != "x$new_ls"; then - echo "dd iflag=noatime updated atime; O_NOATIME bug in your kernel?" >&2 - fail=1 + cat >&2 </dev/null | wc -c` test "$outbytes" -eq 3 || fail=1 -rm -f $tmp_in $tmp_in2 $tmp_sym $tmp_out +rm -f $tmp_in $tmp_in2 $tmp_sym $tmp_out || fail=1 +test $fail -eq 0 && fail=$warn exit $fail -- cgit v1.2.3-54-g00ecf