GNU bug report logs - #7362
dd strangeness

Previous Next

Package: coreutils;

Reported by: Lucia Rotger <lucia <at> aircomp.aero>

Date: Wed, 10 Nov 2010 10:26:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #75 received at 7362 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Pádraig Brady <P <at> draigBrady.com>
Cc: 7362 <at> debbugs.gnu.org, Paul Eggert <eggert <at> cs.ucla.edu>
Subject: Re: bug#7362: dd strangeness
Date: Wed, 02 Mar 2011 14:36:33 +0100
Pádraig Brady wrote:
> On 01/03/11 21:40, Pádraig Brady wrote:
>> On 01/03/11 17:45, Paul Eggert wrote:
>>> On 03/01/2011 03:27 AM, Pádraig Brady wrote:
>>>
>>>> So the standard way to accumulate short reads to a full write,
>>>> is to specify separate ibs and obs (we'd probably want to prompt about
>>>> setting obs too for efficiency)
>>>
>>> Yes, good point, the diagnostic should suggest ibs=N obs=N
>>> (instead of just ibs=N).
>>>
>>> By the way, the relationship between fullblock and ibs=N obs=N is
>>> a curious one, one that I don't fully understand.  If you have
>>> ibs=N obs=N, why would you need fullblock?  This should probably
>>> be documented (preferably by someone who understands it :-).
>>
>> Well as I understand it, it's to do with 'count'.
>> count refers to the number of input reads,
>> both partial and full.
>>
>> So the advice to use iflag=fullblock is probably safer,
>> especially when a count (or skip) is specified.
>
> Thinking about it more, we should at least split up the patch.
> So for the oflag=direct case the attached just enables fullblock
> (as using C_TWOBUFS would require more mem, CPU, and also messes
> up if the user specified a count).
>
> I'm not sure we should try to be more clever than this,
> and accept that dd is a low level tool that can be
> used in a myriad of ways.
...
> Subject: [PATCH] dd: enable iflag=fullblock for oflag=direct or oflag=cio
>
> * NEWS: Mention the change in behavior.
> * doc/coreutils.texi: Document when iflag=fullblock is implied.
> * src/dd.c (scan_args): Enable O_FULLBLOCK when needed.
...
> +** Changes in behavior
> +
> +  dd now enables iflag=fullblock with oflag=direct or oflag=cio
> +  where short reads can have adverse effects.

Thanks.  This looks fine to me.
It is so targeted and affects dd only when a non-POSIX flag is specified,
that I can't imagine it would cause any trouble.




This bug report was last modified 14 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.