]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: suggest dd "sync" flag to maximize "nocache" effectiveness
authorPádraig Brady <P@draigBrady.com>
Mon, 11 Jan 2016 22:31:45 +0000 (22:31 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 13 Jan 2016 11:16:39 +0000 (11:16 +0000)
doc/coreutils.texi (dd invocation): Add oflag=sync to the streaming
example.  Also reference the "direct" flag.  Mention this is only
a request to the system.
* src/dd.c (usage): Mention the "sync" flag along with "nocache".
Also mention that it's only a request to drop the cache.
* THANKS.in: Add reporter Francois Rigault.

THANKS.in
doc/coreutils.texi
src/dd.c

index 5c49006a264cb4d001a994b61cd77855771e66e0..4593f6c0dfdd521816d13f206195f4966b43a3a3 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
@@ -207,6 +207,7 @@ Florian Schlichting                 fschlich@cis.fu-berlin.de
 Florin Iucha                        fiucha@hsys.mic.ro
 Francesco Montorsi                  fr_m@hotmail.com
 François Pinard                     pinard@iro.umontreal.ca
+François Rigault                    rigault.francois@gmail.com
 Frank Adler                         fadler@allesklar.de
 Frank T Lofaro                      ftlofaro@snooks.Egr.UNLV.EDU
 Fred Fish                           fnf@ninemoons.com
index eb5159a445f05056f65e9c54a4f4942370565e65..01791be5b16f8fa86c26a4823da682eaecd615f6 100644 (file)
@@ -8677,12 +8677,18 @@ Use synchronized I/O for both data and metadata.
 @item nocache
 @opindex nocache
 @cindex discarding file cache
-Discard the data cache for a file.
-When count=0 all cache is discarded,
+Request to discard the system data cache for a file.
+When count=0 all cached data for the file is specified,
 otherwise the cache is dropped for the processed
-portion of the file.  Also when count=0
+portion of the file.  Also when count=0,
 failure to discard the cache is diagnosed
 and reflected in the exit status.
+
+Note data that is not already persisted to storage will not
+be discarded from cache, so note the use of the ``sync'' options
+in the examples below, which are used to maximize the
+effectiveness of the @samp{nocache} flag.
+
 Here are some usage examples:
 
 @example
@@ -8695,8 +8701,9 @@ dd of=ofile oflag=nocache conv=notrunc,fdatasync count=0
 # Drop cache for part of file
 dd if=ifile iflag=nocache skip=10 count=10 of=/dev/null
 
-# Stream data using just the read-ahead cache
-dd if=ifile of=ofile iflag=nocache oflag=nocache
+# Stream data using just the read-ahead cache.
+# See also the @samp{direct} flag.
+dd if=ifile of=ofile iflag=nocache oflag=nocache,sync
 @end example
 
 @item nonblock
index d5d01f38a07bd2690304ee704e86937e8260116b..440950ab74fcef74f1678edd7b773727b8cf3ac2 100644 (file)
--- a/src/dd.c
+++ b/src/dd.c
@@ -632,7 +632,8 @@ Each FLAG symbol may be:\n\
         fputs (_("  noatime   do not update access time\n"), stdout);
 #if HAVE_POSIX_FADVISE
       if (O_NOCACHE)
-        fputs (_("  nocache   discard cached data\n"), stdout);
+        fputs (_("  nocache   Request to drop cache.  See also oflag=sync\n"),
+               stdout);
 #endif
       if (O_NOCTTY)
         fputs (_("  noctty    do not assign controlling terminal from file\n"),