From 217618e8bf10a09270291b9825f3181ed2f83dbf Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 3 Apr 2014 13:47:48 +0100 Subject: shred: avoid a data pass on empty files * src/shred.c (do_wipefd): Don't increase the size written for an empty file up to a full block. Also increase the size to OFF_T_MAX in the edge case where we do overflow. * NEWS: Mention the shred improvements from recent changes. * tests/misc/shred-passes.sh: Adjust as we no longer write a BLKSIZE of data for empty files. --- tests/misc/shred-passes.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/misc/shred-passes.sh') diff --git a/tests/misc/shred-passes.sh b/tests/misc/shred-passes.sh index bbd12880c..268af950f 100755 --- a/tests/misc/shred-passes.sh +++ b/tests/misc/shred-passes.sh @@ -20,9 +20,9 @@ print_ver_ shred -# shred a single letter, zero length file which should result in +# shred a single letter, which should result in # 3 random passes and a single rename. -touch f || framework_failure_ +printf 1 > f || framework_failure_ echo "\ shred: f: pass 1/3 (random)... shred: f: pass 2/3 (random)... @@ -35,15 +35,15 @@ shred -v -u f 2>out || fail=1 compare exp out || fail=1 -# Likewise but with --exact to bypass the -# data passes for the zero length file +# Likewise but for a zero length file +# to bypass the data passes touch f || framework_failure_ echo "\ shred: f: removing shred: f: renamed to 0 shred: f: removed" > exp || framework_failure_ -shred -x -v -u f 2>out || fail=1 +shred -v -u f 2>out || fail=1 compare exp out || fail=1 -- cgit v1.2.3-54-g00ecf