summaryrefslogtreecommitdiffhomepage
path: root/pkg/segment/set_state.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-08-27 16:52:21 -0700
committerAndrei Vagin <avagin@gmail.com>2020-09-09 17:53:10 -0700
commitbb089f9c9075a78e8bde7ff946bac77badc08894 (patch)
tree86026686e411a273239a8a5637853194c6e97022 /pkg/segment/set_state.go
parent05166f14c93323d6279987ae3fe9a803ad188ade (diff)
Fix vfs2 pipe behavior when splicing to a non-pipe.
Fixes *.sh Java runtime tests, where splice()-ing from a pipe to /dev/zero would not actually empty the pipe. There was no guarantee that the data would actually be consumed on a splice operation unless the output file's implementation of Write/PWrite actually called VFSPipeFD.CopyIn. Now, whatever bytes are "written" are consumed regardless of whether CopyIn is called or not. Furthermore, the number of bytes in the IOSequence for reads is now capped at the amount of data actually available. Before, splicing to /dev/zero would always return the requested splice size without taking the actual available data into account. This change also refactors the case where an input file is spliced into an output pipe so that it follows a similar pattern, which is arguably cleaner anyway. Updates #3576. PiperOrigin-RevId: 328843954
Diffstat (limited to 'pkg/segment/set_state.go')
0 files changed, 0 insertions, 0 deletions