Skip to content

rm: "traversal failed" is not shown when 2nd getdents64 failed on broken device #15206

Open

Description

@oech3
$ mkdir -p dir/nonempty
$ strace -e trace=getdents64 -e fault=getdents64:error=EIO:when=2 '/home/a/bin/gnu9.12/rm' -Rf dir
getdents64(3, 0x55ea90f71890 /* 3 entries */, 32768) = 80
getdents64(3, 0x55ea90f71890, 32768)    = -1 EIO (Input/output error) (INJECTED)
getdents64(3, 0x55ea90f71890 /* 2 entries */, 32768) = 48
getdents64(3, 0x55ea90f71890 /* 0 entries */, 32768) = 0
rm: traversal failed: dir: Input/output error
+++ exited with 1 +++
$ mkdir -p dir/nonempty
$ strace -e trace=getdents64 -e fault=getdents64:error=EIO:when=2 rm -Rf dir
getdents64(3, 0x7ffda48701a8 /* 3 entries */, 8192) = 80
getdents64(3, 0x7ffda48701a8, 8192)     = -1 EIO (Input/output error) (INJECTED)
getdents64(3, 0x560de267a060 /* 3 entries */, 32768) = 80
rm: cannot remove 'dir': Directory not empty
+++ exited with 1 +++

Activity

  1. Franklin-Qi commented on Oct 9, 2026

    @Franklin-Qi
    Contributor

    I have reproduced it, I could handle it soon.

  2. oech3 commented on Oct 9, 2026

    @oech3
    ContributorAuthor

    @ChrisDryden Are you OK with replacing #9604 as it is inactive?

  3. added 4 commits that reference this issue on Oct 10, 2026
    63bd6f2
    13e0456
    444e7a5
    166a6a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions