GNU bug report logs -
#51345
dd with conv=fsync sometimes returns when its writes are still cached
Previous Next
Full log
Message #26 received at 51345 <at> debbugs.gnu.org (full text, mbox):
On 28/10/2021 22:59, Sworddragon wrote:
> Despite I'm not using Linux as main system anymore and wanted to avoid
> getting into too much work I found some time to do some tests as this issue
> bugs me just too much.
>
>> You could try running the following immediately after,
>> to see if it also returns quickly:
>>
>> blockdev --flushbufs /dev/sdb
>
> Yes, this command also blocks for a bit over 1 minute when this issue
> occurs.
Right, so that suggests conv=fsync on dd was ineffective.
> Here is the output (I had to freely translate the strings since
> this Knoppix instance is only in german so they might be slightly
> inaccurate; Also I had to type all text since it was executed on a
> different system but carefully checked to not introduce any typos):
>
> root <at> Microknoppix:~# dd if=/dev/random of=/dev/sdb bs=1M conv=fsync
> status=progress
> 1039138816 Bytes(1,0 GB, 991 MiB) copied, 56 s, 18,5 MB/s
> dd: Error on writing '/dev/sdb': The device has not enough free space
> 999+0 records in
> 998+0 records out
Ah right. What's probably happening is that dd is not doing the fsync
because it's exiting early because of the ENOSPC from write(2).
To avoid needing the buffer drain (with fsync), you can use
This bug report was last modified 3 years and 119 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.