From 5929322ccb1f9d27c1b07b746d37419d17a7cbf6 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 4 Aug 2009 19:54:58 +0200 Subject: dd: work around buffer length restrictions with oflag=direct (O_DIRECT) dd oflag=direct would fail to copy a file with size that is not a multiple of 512 (destination file system specific) * NEWS (Bug fixes): Mention it. * src/dd.c (iwrite): Turn off O_DIRECT for any smaller-than-obs-sized write. Don't bother to restore it. * tests/dd/direct: New test for the above. * tests/Makefile.am (TESTS): Add dd/direct. * doc/coreutils.texi (dd invocation): Mention oflag=direct buffer size restriction. Details in http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/17586 Reported by Eric Sandeen. --- doc/coreutils.texi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index acec76e4c..90a54b268 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7861,6 +7861,10 @@ same time. @opindex direct @cindex direct I/O Use direct I/O for data, avoiding the buffer cache. +Note that the kernel may impose restrictions on read or write buffer sizes. +For example, with an ext4 destination file system and a linux-based kernel, +using @samp{oflag=direct} will cause writes to fail with @code{EINVAL} if the +output buffer size is not a multiple of 512. @item directory @opindex directory -- cgit v1.2.3-70-g09d2