Skip to content

fix(truncate): implement --io-blocks - #13432

Merged
cakebaker merged 1 commit into
uutils:mainfrom
ThomasHabets:truncate-blocks
Sep 2, 2026
Merged

fix(truncate): implement --io-blocks#13432
cakebaker merged 1 commit into
uutils:mainfrom
ThomasHabets:truncate-blocks

Conversation

@ThomasHabets

@ThomasHabets ThomasHabets commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Scale SIZE by the preferred I/O block size of each output file, using the parent filesystem for files that do not exist yet.

Before

truncate --io-blocks --size=1 file produced a 1-byte file.

After

The same command produces a 4096-byte file on a filesystem with 4096-byte I/O blocks.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/rm/isatty (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

@codspeed-hq

codspeed-hq Bot commented Jul 20, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 339 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing ThomasHabets:truncate-blocks (d6e060f) with main (ef50d8b)

Open in CodSpeed

Footnotes

  1. 46 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ThomasHabets
ThomasHabets force-pushed the truncate-blocks branch 4 times, most recently from a3b2fb2 to 8e1a17d Compare August 28, 2026 12:26
@sylvestre
sylvestre requested a lite review from Copilot August 28, 2026 12:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sylvestre

Copy link
Copy Markdown
Contributor

Looks good

@ThomasHabets

Copy link
Copy Markdown
Contributor Author

Not sure what this means. Is it a false positive? I seem to be rebased correctly on top of HEAD

REGRESSIONS (non-intermittent failures):
Error: GNU test failed: tests/dd/misc. tests/dd/misc is passing on 'main'. Maybe you have to rebase?
Error: GNU test failed: tests/df/over-mount-device. tests/df/over-mount-device is passing on 'main'. Maybe you have to rebase?

@ThomasHabets
ThomasHabets marked this pull request as ready for review August 28, 2026 13:11
@cakebaker

Copy link
Copy Markdown
Contributor

@ThomasHabets yes, it's a false positive.

Scale SIZE by the preferred I/O block size of each output file, using
the parent filesystem for files that do not exist yet.

Before:

`truncate --io-blocks --size=1 a` file produced a 1-byte file.

After:

The same command produces a 4096-byte file on a filesystem with
4096-byte I/O blocks.
@cakebaker
cakebaker merged commit ddc98c2 into uutils:main Sep 2, 2026
102 of 103 checks passed
@cakebaker

Copy link
Copy Markdown
Contributor

Thanks!

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.

4 participants