Skip to content

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

@oech3

Description

@oech3
> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions