<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/shred.c, branch v8.22</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.22</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.22'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2013-11-27T01:43:12Z</updated>
<entry>
<title>shred: provide --remove methods to avoid excessive syncing</title>
<updated>2013-11-27T01:43:12Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-07T17:00:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=569b4edd18cddb5a8cc1f9549a7c1eed91b674f7'/>
<id>urn:sha1:569b4edd18cddb5a8cc1f9549a7c1eed91b674f7</id>
<content type='text'>
A sync operation is very often expensive.  For illustration
I timed the following python script which indicated that
each ext4 dir sync was taking about 2ms and 12ms, on an
SSD and traditional disk respectively.

  import os
  d=os.open(".", os.O_DIRECTORY|os.O_RDONLY)
  for i in range(1000):
     os.fdatasync(d)

So syncing for each character for each file can result
in significant delays.  Often this overhead is redundant,
as only the data is sensitive and not the file name.
Even if the names are sensitive, your file system may
employ synchronous metadata updates, which also makes
explicit syncing redundant.

* tests/misc/shred-remove.sh: Ensure all the new parameters
actually unlink the file.
* doc/coreutils.texi (shred invocation): Describe the new
parameters to the --remove option.
* src/shred.c (Usage): Likewise.
(main): Parse the new options.
(wipename): Inspect the new enum to see which of
the now optional tasks to perform.
* NEWS: Mention the new feature.
* THANKS.in: Add reporter Joseph D. Wagner
</content>
</entry>
<entry>
<title>shred: avoid data write pass with --size=0</title>
<updated>2013-11-08T13:39:35Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-07T12:32:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=90181a5926e96f34b5ffff21b81a2874a846ff6f'/>
<id>urn:sha1:90181a5926e96f34b5ffff21b81a2874a846ff6f</id>
<content type='text'>
* src/shred.c (dopass): Exit early to avoid redundant heap
allocation, and more importantly avoiding a file sync
when we're writting no data, as this can have side effects.
Also with --verbose, this avoids printing of "pass status"
which could be confusing as to whether data was actually written.
* tests/misc/shred-passes.sh: Ensure the status for data
passes are not written when not doing any data writes.
</content>
</entry>
<entry>
<title>shred: increase I/O block size for periodic pattern case</title>
<updated>2013-11-08T13:39:35Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-07T11:57:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c2eaef2f57153a22b6dc075b1adc9fde1a4eb7bd'/>
<id>urn:sha1:c2eaef2f57153a22b6dc075b1adc9fde1a4eb7bd</id>
<content type='text'>
* src/shred.c (dopass): In the periodic pattern case increase the
I/O block size from 12KiB to 60KiB (also a multiple of 3 and 4096).
* NEWS: Adjust accordingly.
</content>
</entry>
<entry>
<title>shred: fix direct I/O failures for last write to file</title>
<updated>2013-11-08T13:33:50Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-07T13:26:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c93d5b4aa7f675dabaebf5e4ee9583162e4c977d'/>
<id>urn:sha1:c93d5b4aa7f675dabaebf5e4ee9583162e4c977d</id>
<content type='text'>
Since direct I/O is now enabled with commit v8.21-139-gebaf961
we must handle the case where we write an odd size at the
end of a file (with --exact), or we specify an odd --size that
is larger than 64KiB, or in the very unlikely case of a device
with an odd size.  This issue was present since direct I/O
support was first added in v5.3.0, but latent since v6.0.
Theoretically this could have also been an issue after that on
systems which didn't have alignment constraints, but did have
size constraints for direct I/O.

* src/shred.c (dopass): On the first pass for a file, always
retry a write that fails with EINVAL, so we handle direct I/O
failure at either the start or end of the file.  Adjust the comment
as the original case is out of date and implicitly handled
by this more general fix.
* tests/misc/shred-exact.sh: Add a test case.
* NEWS: Add a "bug fix" entry for shred since there are
two related issues now fixed.
</content>
</entry>
<entry>
<title>shred: write larger chunks when possible</title>
<updated>2013-11-06T17:43:13Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-04T23:14:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2c6736f92fc7d2f310714473ea84ceff57e01da2'/>
<id>urn:sha1:2c6736f92fc7d2f310714473ea84ceff57e01da2</id>
<content type='text'>
* src/shred.c (dopass): When not needing to write periodic patterns,
use a 64KiB block size to reduce the number of write system calls.
</content>
</entry>
<entry>
<title>shred: enable direct I/O when possible</title>
<updated>2013-11-05T13:43:20Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2013-11-04T23:14:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ebaf961f3ad9ae7e8f9258e46eadb0e0d5e30ade'/>
<id>urn:sha1:ebaf961f3ad9ae7e8f9258e46eadb0e0d5e30ade</id>
<content type='text'>
Commit v5.92-1057-g43d487b introduced a regression
in coreutils 6.0 where it removed the page alignment
of the buffer to write, thus disabling direct I/O.
We want to use direct I/O when possible to avoid
impacting the page cache at least, as we know we don't
want to cache the data we're writing.

* src/shred.c (dopass): Allocate the buffer on the heap,
while using a more general calculation to allow to have
the output size independent from the fillpattern() size
constraint of a multiple of 3.  Also we dispense with the
union as it's no longer needed given we're aligning on
a page boundary and thus don't need to explicitly handle
uint32_t alignment.
</content>
</entry>
<entry>
<title>maint: define usage note about mandatory args centrally</title>
<updated>2013-01-23T00:03:38Z</updated>
<author>
<name>Bernhard Voelker</name>
<email>mail@bernhard-voelker.de</email>
</author>
<published>2013-01-23T00:03:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=4eaadb47430f21aee83eb920378be01945845a9a'/>
<id>urn:sha1:4eaadb47430f21aee83eb920378be01945845a9a</id>
<content type='text'>
Each program with at least one long option which is marked as
'required_argument' and which has also a short option for that
option, should print a note about mandatory arguments.
Define that well-known note centrally and use it rather than
literal printf/fputs, and add it where it was missing.

* src/system.h (emit_mandatory_arg_note): Add new function.

* src/cp.c (usage): Use it rather than literal printf/fputs.
* src/csplit.c, src/cut.c, src/date.c, src/df.c, src/du.c:
* src/expand.c, src/fmt.c, src/fold.c, src/head.c, src/install.c:
* src/kill.c, src/ln.c, src/ls.c, src/mkdir.c, src/mkfifo.c:
* src/mknod.c, src/mv.c, src/nl.c, src/od.c, src/paste.c:
* src/pr.c, src/ptx.c, src/shred.c, src/shuf.c, src/sort.c:
* src/split.c, src/stdbuf.c, src/tac.c, src/tail.c, src/timeout.c:
* src/touch.c, src/truncate.c, src/unexpand.c, src/uniq.c:
Likewise.

* src/base64.c (usage): Add call of the above new function
because at least one long option has a required argument.
* src/basename.c, src/chcon.c, src/date.c, src/env.c:
* src/nice.c, src/runcon.c, src/seq.c, src/stat.c, src/stty.c:
Likewise.
</content>
</entry>
<entry>
<title>maint: update all copyright year number ranges</title>
<updated>2013-01-01T03:51:20Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2013-01-01T02:54:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=77da73c75432f3c5b4beebae7b0797a1e33160bc'/>
<id>urn:sha1:77da73c75432f3c5b4beebae7b0797a1e33160bc</id>
<content type='text'>
Run "make update-copyright", but then also run this,
  perl -pi -e 's/2\d\d\d-//' tests/sample-test
to make that one script use the single most recent year number.
</content>
</entry>
<entry>
<title>build: shred.c: avoid i686-specific gcc -Wstrict-overflow warning</title>
<updated>2012-07-15T09:39:01Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-07-15T09:31:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3c2973b86e70f184e95c4c87086095f52c2bb493'/>
<id>urn:sha1:3c2973b86e70f184e95c4c87086095f52c2bb493</id>
<content type='text'>
* src/shred.c: Avoid gcc -Wstrict-overflow warning.
Addresses http://bugs.gnu.org/11927
</content>
</entry>
<entry>
<title>maint: src/*.[ch]: convert more `...' to '...'</title>
<updated>2012-01-09T20:51:59Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2012-01-08T20:03:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3ba8b044267a5f7cfa8a7b0d7f19dab3f21431da'/>
<id>urn:sha1:3ba8b044267a5f7cfa8a7b0d7f19dab3f21431da</id>
<content type='text'>
Run this (twice):
  git grep -E -l '`.+'\' src/*.[ch] \
    |xargs perl -pi -e 's/`(.+?'\'')/'\''$1/'
</content>
</entry>
</feed>
