coreutils
[Top][All Lists]
Advanced

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

Re: coreutils-8.15.74-be17e3 on OpenBSD


From: Pádraig Brady
Subject: Re: coreutils-8.15.74-be17e3 on OpenBSD
Date: Sat, 17 Mar 2012 09:56:11 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0) Gecko/20110816 Thunderbird/6.0

This is from the dd/sparse failure:

On 03/17/2012 02:31 AM, Bruno Haible wrote:
> + alloc_equal file.in file.out
> + : 4
> +++ stat -c %b file.in
> +++ stat -c %b file.out
> ++ expr 4160 - 4128
> + alloc_diff=32
> ++ echo 32
> ++ tr -d -- -
> + alloc_diff=32
> + test 32 -le 4
> + fail=1

That confirms that sparse granularity is
coarser than I assumed on the BSDs.

Perhaps this is appropriate:

diff --git a/tests/dd/sparse b/tests/dd/sparse
index 17aa94b..203e103 100755
--- a/tests/dd/sparse
+++ b/tests/dd/sparse
@@ -51,10 +51,10 @@ dd if=/dev/urandom of=file.in bs=1M count=1 conv=notrunc 
oflag=append
 # but can vary by a file system block due to alignment,
 # which was seen on XFS at least.
 alloc_equal() {
-  : ${sectors_per_block:=$(expr $(stat -f -c "%S" .) / 512)}
+  : ${sectors_per_sparse_block:=$(expr $(stat -f -c "%S" .) / 64)}
   alloc_diff=$(expr $(stat -c %b "$1") - $(stat -c %b "$2"))
   alloc_diff=$(echo $alloc_diff | tr -d -- -) # abs()
-  test $alloc_diff -le $sectors_per_block
+  test $alloc_diff -le $sectors_per_sparse_block
 }




reply via email to

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