[Bug 229616] bin/dd does not check output's close() return code
bugzilla-noreply at freebsd.org
bugzilla-noreply at freebsd.org
Sun Jul 8 21:27:32 UTC 2018
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229616
Bug ID: 229616
Summary: bin/dd does not check output's close() return code
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Some People
Priority: ---
Component: bin
Assignee: bugs at FreeBSD.org
Reporter: tom at hur.st
In dd's main():
dd_close();
/*
* Some devices such as cfi(4) may perform significant amounts
* of work when a write descriptor is closed. Close the out
* descriptor explicitly so that the summary handler (called
* from an atexit() hook) includes this work.
*/
close(out.fd);
exit(0);
dd_close() comments *claim* it flushes output, but this appears to be a lie -
it just finishes off any pending calls to write(), it doesn't ask they be
flushed to disk.
IO errors from previous writes that were later flushed to disk can end up
reported in close(), for example as mentioned in close(2):
[ENOSPC] The underlying object did not fit, cached data was lost
Obviously a dd that can exit 0 while also losing data is.. unfortunate.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the freebsd-bugs
mailing list