bug#51345: dd with conv=fsync sometimes returns when its writes are still cached

2022-01-28 Thread Paul Eggert
after write errors Problem reported by Sworddragon (Bug#51345). * src/dd.c (cleanup): Synchronize output unless dd has been interrupted. (synchronize_output): New function, split out from dd_copy. Update conversions_mask so synchronization is done at most once. (main): Do not die with the output

bug#51345:

2021-10-29 Thread Paul Eggert
On 10/29/21 05:38, Pádraig Brady wrote: I'm leaning towards improving this by always doing an fsync on exit if we get a read or write error and have successfully written any data, so that previously written data is sync'd as requested. Sounds like a good idea to me too.

bug#51345:

2021-10-29 Thread Pádraig Brady
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

bug#51345:

2021-10-29 Thread Sworddragon
I got an email that somebody replied to this report but it looks like they did send it to the wrong mail address (maybe they will be merged in order) but I will still reply to it: > Suggestion as a possible workaround: Have a look at random(4) and random(7), > and ask yourself whether your use of

bug#51345:

2021-10-29 Thread Pádraig Brady
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

bug#51345:

2021-10-28 Thread Sworddragon
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

bug#51345: dd with conv=fsync sometimes returns when its writes are still cached

2021-10-25 Thread Bob Proulx
Sworddragon wrote: > On Knoppix 9.1 with the Linux Kernel 5.10.10-64 x86_64 and GNU Coreutils > 8.32 I wanted to overwrite my USB Thumb Drive a few times with random data > via "dd if=/dev/random of=/dev/sdb bs=1M conv=fsync". While it usually > takes ~2+ minutes to perform this action dd returned

bug#51345:

2021-10-24 Thread Sworddragon
> You could try running the following immediately after, > to see if it also returns quickly: > >blockdev --flushbufs /dev/sdb The issue does not reproduce always and the related USB Thumb Drive has already been prepared for and does store important data so that is not an easy task. The USB

bug#51345: dd with conv=fsync sometimes returns when its writes are still cached

2021-10-23 Thread Pádraig Brady
On 23/10/2021 09:18, Sworddragon wrote: On Knoppix 9.1 with the Linux Kernel 5.10.10-64 x86_64 and GNU Coreutils 8.32 I wanted to overwrite my USB Thumb Drive a few times with random data via "dd if=/dev/random of=/dev/sdb bs=1M conv=fsync". While it usually takes ~2+ minutes to perform this

bug#51345: dd with conv=fsync sometimes returns when its writes are still cached

2021-10-23 Thread Sworddragon
On Knoppix 9.1 with the Linux Kernel 5.10.10-64 x86_64 and GNU Coreutils 8.32 I wanted to overwrite my USB Thumb Drive a few times with random data via "dd if=/dev/random of=/dev/sdb bs=1M conv=fsync". While it usually takes ~2+ minutes to perform this action dd returned once after less than 60