Skip to content

buf_copy: remove unnecessary flush#12405

Closed
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:no-flush-copy-stream
Closed

buf_copy: remove unnecessary flush#12405
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:no-flush-copy-stream

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented May 20, 2026

  • replace direct trait use with FdReadable and FdWritable traits for improved abstraction
  • avoid blanket trait implementations to ensure only valid types (files or pipes) are used
  • remove unnecessary .flush() since File and PipeWriter are unbuffered

Closes #12401

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented May 20, 2026

I already opened PR for this. Please close this.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@oech3 Sorry I missed that PR, it looks like these changes are an improvement though?

@xtqqczze xtqqczze marked this pull request as ready for review May 20, 2026 17:37
@xtqqczze xtqqczze marked this pull request as draft May 20, 2026 19:16
@xtqqczze xtqqczze force-pushed the no-flush-copy-stream branch from 8837420 to 493eff2 Compare May 20, 2026 19:16
@xtqqczze xtqqczze changed the title buf_copy: remove unnecessary flush buf_copy: unify platform implementations May 20, 2026
@xtqqczze xtqqczze force-pushed the no-flush-copy-stream branch 2 times, most recently from f41dc59 to a393edb Compare May 20, 2026 19:30
@xtqqczze xtqqczze force-pushed the no-flush-copy-stream branch from a393edb to 8f129a7 Compare May 20, 2026 19:34
@xtqqczze xtqqczze changed the title buf_copy: unify platform implementations buf_copy: remove unnecessary flush May 20, 2026
@xtqqczze xtqqczze marked this pull request as ready for review May 20, 2026 19:49
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout-group (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (was skipped on 'main', now failing)

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented May 21, 2026

This PR with PipeReader is invalid:

> strace -c -e splice cp /dev/stdin /tmp/a
a
a
a
^Cstrace: Process 1128 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.001080         180         6           splice

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented May 21, 2026

BUGFS is broken with io::copy #9609 (comment) . So internal kernel_copy should be bypassed by RawReader.
[Edit] ignore this comment. Here is not a place we can fix it...

@xtqqczze xtqqczze closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants