uutils / uutils/coreutils

dd iflag=nocache should silently ignore fadvise's error in some cases

Open
#12,571 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

U - dd
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

> strace -qqq -e trace='/fadvise' gnu9.11/dd if=/etc/pacman.conf iflag=nocache>/dev/null
fadvise64(0, 0, 0, POSIX_FADV_DONTNEED) = 0
1+1 records in
1+1 records out
535 bytes copied, 0.000246046 s, 2.2 MB/s

> strace -o /dev/null -e inject=fadvise64:error=ENOSYS gnu9.11/dd if=/etc/pacman.conf iflag=nocache >/dev/null
1+1 records in
1+1 records out
535 bytes copied, 0.000378318 s, 1.4 MB/s

> strace -o /dev/null -e inject=fadvise64:error=ENOSYS dd if=/etc/pacman.conf iflag=nocache >/dev/null
dd: failed to discard cache for: /etc/pacman.conf: Function not implemented
dd: failed to discard cache for: /etc/pacman.conf: Function not implemented
dd: failed to discard cache for: /etc/pacman.conf: Function not implemented
1+1 records in
1+1 records out
535 bytes copied, 0.00134043 s, 535 kB/s
# exit 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with dd iflag=nocache and the injected fadvise64 ENOSYS error, comparing the output with gnu9.11. Trace the dd handling for cache-discard errors and identify the cases covered by the report. Done means the applicable error is silently ignored while dd still completes as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.